Lines Matching refs:jws

187  * - The jwe->jws.jwk is the PEER - the encryption consumer's - public key.
211 if (jwe->jws.jwk->kty != LWS_GENCRYPTO_KTY_EC) {
212 lwsl_err("%s: unexpected kty %d\n", __func__, jwe->jws.jwk->kty);
222 if (lws_genecdh_create(&ecctx, jwe->jws.context, NULL))
227 jwe->jws.jwk->e[LWS_GENCRYPTO_EC_KEYEL_CRV].buf,
232 if (lws_genecdh_set_key(&ecctx, jwe->jws.jwk->e, LDHS_THEIRS)) {
296 if (lws_get_random(jwe->jws.context, cek, (unsigned int)enc_hlen) !=
317 (void *)jwe->jws.map.buf[LJWE_EKEY],
329 jwe->jws.map.len[LJWE_EKEY] = (unsigned int)enc_hlen + 8;
338 jwe->jws.map.buf[LJWE_JOSE] = temp;
355 jwe->jws.map.len[LJWE_JOSE] = (unsigned int)m;
359 if (lws_jws_encode_b64_element(&jwe->jws.map_b64, LJWE_JOSE,
361 jwe->jws.map.buf[LJWE_JOSE],
362 jwe->jws.map.len[LJWE_JOSE]))
389 if (lws_jws_alloc_element(&jwe->jws.map, LJWE_EKEY,
407 if (lws_jws_alloc_element(&jwe->jws.map, LJWE_ATAG,
412 if (lws_jws_alloc_element(&jwe->jws.map, LJWE_IV,
421 (uint8_t *)jwe->jws.map_b64.buf[LJWE_JOSE],
422 (int)jwe->jws.map_b64.len[LJWE_JOSE]);
433 if (jwe->jws.map.len[LJWE_EKEY])
434 lws_explicit_bzero((void *)jwe->jws.map.buf[LJWE_EKEY],
435 jwe->jws.map.len[LJWE_EKEY]);
436 jwe->jws.map.len[LJWE_EKEY] = 0;
445 * jwe->jws.jwk is recipient private key
462 if (jwe->jws.jwk->kty != LWS_GENCRYPTO_KTY_EC) {
463 lwsl_err("%s: unexpected kty %d\n", __func__, jwe->jws.jwk->kty);
485 if (lws_genecdh_create(&ecctx, jwe->jws.context, NULL))
490 if (lws_genecdh_set_key(&ecctx, jwe->jws.jwk->e, LDHS_OURS)) {
545 if (jwe->jws.map.len[LJWE_EKEY] < (unsigned int)enc_hlen) {
566 (const uint8_t *)jwe->jws.map.buf[LJWE_EKEY],
567 jwe->jws.map.len[LJWE_EKEY],
585 (uint8_t *)jwe->jws.map_b64.buf[LJWE_JOSE],
586 (int)jwe->jws.map_b64.len[LJWE_JOSE]) < 0) {
609 if (lws_jws_encode_b64_element(&jwe->jws.map_b64, LJWE_JOSE,
611 jwe->jws.map.buf[LJWE_JOSE],
612 jwe->jws.map.len[LJWE_JOSE]))