Lines Matching defs:oc
90 OMAContext *oc = s->priv_data;
99 if (r_val != oc->r_val) {
100 memset(oc->r_val, 0, 24);
101 memcpy(oc->r_val, r_val, len);
103 memcpy(&oc->r_val[16], r_val, 8);
106 if (n_val != oc->n_val) {
107 memset(oc->n_val, 0, 24);
108 memcpy(oc->n_val, n_val, len);
110 memcpy(&oc->n_val[16], n_val, 8);
118 OMAContext *oc = s->priv_data;
127 av_des_crypt(&av_des, oc->m_val, &enc_header[48], 1, NULL, 1);
130 av_des_init(&av_des, oc->m_val, 64, 0);
131 av_des_crypt(&av_des, oc->s_val, NULL, 1, NULL, 0);
134 pos = OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size;
135 av_des_init(&av_des, oc->s_val, 64, 0);
136 av_des_mac(&av_des, oc->sm_val, &enc_header[pos], (oc->i_size >> 3));
138 pos += oc->i_size;
140 return memcmp(&enc_header[pos], oc->sm_val, 8) ? -1 : 0;
145 OMAContext *oc = s->priv_data;
152 pos = OMA_ENC_HEADER_SIZE + oc->k_size;
156 if (AV_RB32(&enc_header[pos]) != oc->rid)
166 av_des_crypt(&av_des, oc->r_val, &enc_header[pos], 2, NULL, 1);
167 kset(s, oc->r_val, NULL, 16);
168 if (!rprobe(s, enc_header, oc->r_val))
178 OMAContext *oc = s->priv_data;
182 oc->encrypted = 1;
210 oc->k_size = AV_RB16(&gdata[2]);
211 oc->e_size = AV_RB16(&gdata[4]);
212 oc->i_size = AV_RB16(&gdata[6]);
213 oc->s_size = AV_RB16(&gdata[8]);
219 oc->rid = AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]);
220 av_log(s, AV_LOG_DEBUG, "RID: %.8x\n", oc->rid);
222 memcpy(oc->iv, &header[0x58], 8);
223 hex_log(s, AV_LOG_DEBUG, "IV", oc->iv, 8);
225 hex_log(s, AV_LOG_DEBUG, "CBC-MAC", &gdata[OMA_ENC_HEADER_SIZE+oc->k_size+oc->e_size+oc->i_size], 8);
230 if (!memcmp(oc->r_val, (const uint8_t[8]){0}, 8) ||
231 rprobe(s, gdata, oc->r_val) < 0 &&
232 nprobe(s, gdata, oc->n_val) < 0) {
239 if (!rprobe(s, gdata, oc->r_val) || !nprobe(s, gdata, oc->n_val))
249 av_des_init(&oc->av_des, oc->m_val, 64, 0);
250 av_des_crypt(&oc->av_des, oc->e_val, &gdata[OMA_ENC_HEADER_SIZE + 40], 1, NULL, 0);
251 hex_log(s, AV_LOG_DEBUG, "EK", oc->e_val, 8);
254 av_des_init(&oc->av_des, oc->e_val, 64, 1);
269 OMAContext *oc = s->priv_data;
281 oc->content_start = avio_tell(s->pb);
376 OMAContext *oc = s->priv_data;
385 if (oc->encrypted) {
387 av_des_crypt(&oc->av_des, pkt->data, pkt->data, (packet_size >> 3), oc->iv, 1);
423 OMAContext *oc = s->priv_data;
427 if (oc->encrypted) {
430 if (pos < oc->content_start)
431 memset(oc->iv, 0, 8);
433 if (avio_seek(s->pb, -8, SEEK_CUR) < 0 || avio_read(s->pb, oc->iv, 8) < 8) {
434 memset(oc->iv, 0, 8);