Lines Matching defs:oc
94 OMAContext *oc = s->priv_data;
103 if (r_val != oc->r_val) {
104 memset(oc->r_val, 0, 24);
105 memcpy(oc->r_val, r_val, len);
107 memcpy(&oc->r_val[16], r_val, 8);
110 if (n_val != oc->n_val) {
111 memset(oc->n_val, 0, 24);
112 memcpy(oc->n_val, n_val, len);
114 memcpy(&oc->n_val[16], n_val, 8);
125 OMAContext *oc = s->priv_data;
130 size < OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size + oc->i_size ||
136 av_des_crypt(&av_des, oc->m_val, &enc_header[48], 1, NULL, 1);
139 av_des_init(&av_des, oc->m_val, 64, 0);
140 av_des_crypt(&av_des, oc->s_val, NULL, 1, NULL, 0);
143 pos = OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size;
144 av_des_init(&av_des, oc->s_val, 64, 0);
145 av_des_mac(&av_des, oc->sm_val, &enc_header[pos], (oc->i_size >> 3));
147 pos += oc->i_size;
149 return memcmp(&enc_header[pos], oc->sm_val, 8) ? -1 : 0;
155 OMAContext *oc = s->priv_data;
161 size < OMA_ENC_HEADER_SIZE + oc->k_size + 4)
164 pos = OMA_ENC_HEADER_SIZE + oc->k_size;
171 if (AV_RB32(&enc_header[pos]) != oc->rid)
184 av_des_crypt(&av_des, oc->r_val, &enc_header[pos], 2, NULL, 1);
185 kset(s, oc->r_val, NULL, 16);
186 if (!rprobe(s, enc_header, size, oc->r_val))
196 OMAContext *oc = s->priv_data;
200 oc->encrypted = 1;
229 oc->k_size = AV_RB16(&gdata[2]);
230 oc->e_size = AV_RB16(&gdata[4]);
231 oc->i_size = AV_RB16(&gdata[6]);
232 oc->s_size = AV_RB16(&gdata[8]);
238 if (OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size + oc->i_size + 8 > geob->datasize ||
243 oc->rid = AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]);
244 av_log(s, AV_LOG_DEBUG, "RID: %.8"PRIx32"\n", oc->rid);
246 memcpy(oc->iv, &header[0x58], 8);
247 hex_log(s, AV_LOG_DEBUG, "IV", oc->iv, 8);
250 &gdata[OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size + oc->i_size],
256 if (!memcmp(oc->r_val, (const uint8_t[8]){0}, 8) ||
257 rprobe(s, gdata, geob->datasize, oc->r_val) < 0 &&
258 nprobe(s, gdata, geob->datasize, oc->n_val) < 0) {
265 if (!rprobe(s, gdata, geob->datasize, oc->r_val) ||
266 !nprobe(s, gdata, geob->datasize, oc->n_val))
276 av_des_init(&oc->av_des, oc->m_val, 64, 0);
277 av_des_crypt(&oc->av_des, oc->e_val,
279 hex_log(s, AV_LOG_DEBUG, "EK", oc->e_val, 8);
282 av_des_init(&oc->av_des, oc->e_val, 64, 1);
296 OMAContext *oc = s->priv_data;
309 oc->content_start = avio_tell(s->pb);
415 OMAContext *oc = s->priv_data;
429 if (oc->encrypted) {
433 av_des_crypt(&oc->av_des, pkt->data, pkt->data,
434 (packet_size >> 3), oc->iv, 1);
436 memset(oc->iv, 0, 8);
466 OMAContext *oc = s->priv_data;
469 if (!oc->encrypted)
473 if (err || avio_tell(s->pb) < oc->content_start)
477 if ((err = avio_read(s->pb, oc->iv, 8)) < 8) {
485 memset(oc->iv, 0, 8);