• Home
  • Raw
  • Download

Lines Matching refs:jws

54 	if (jwe->jws.jwk->kty != LWS_GENCRYPTO_KTY_RSA) {  in lws_jwe_encrypt_rsa_aes_cbc_hs()
55 lwsl_err("%s: unexpected kty %d\n", __func__, jwe->jws.jwk->kty); in lws_jwe_encrypt_rsa_aes_cbc_hs()
66 if (lws_jws_encode_b64_element(&jwe->jws.map_b64, LJWE_JOSE, in lws_jwe_encrypt_rsa_aes_cbc_hs()
68 jwe->jws.map.buf[LJWE_JOSE], in lws_jwe_encrypt_rsa_aes_cbc_hs()
69 jwe->jws.map.len[LJWE_JOSE])) in lws_jwe_encrypt_rsa_aes_cbc_hs()
72 if (lws_jws_alloc_element(&jwe->jws.map, LJWE_ATAG, temp + (ot - *temp_len), in lws_jwe_encrypt_rsa_aes_cbc_hs()
76 if (lws_jws_alloc_element(&jwe->jws.map, LJWE_IV, temp + (ot - *temp_len), in lws_jwe_encrypt_rsa_aes_cbc_hs()
84 if (lws_jws_dup_element(&jwe->jws.map, LJWE_EKEY, temp + (ot - *temp_len), in lws_jwe_encrypt_rsa_aes_cbc_hs()
85 temp_len, jwe->jws.map.buf[LJWE_EKEY], in lws_jwe_encrypt_rsa_aes_cbc_hs()
86 jwe->jws.map.len[LJWE_EKEY], in lws_jwe_encrypt_rsa_aes_cbc_hs()
87 jwe->jws.jwk->e[LWS_GENCRYPTO_RSA_KEYEL_N].len)) in lws_jwe_encrypt_rsa_aes_cbc_hs()
92 n = lws_jwe_encrypt_cbc_hs(jwe, (uint8_t *)jwe->jws.map.buf[LJWE_EKEY], in lws_jwe_encrypt_rsa_aes_cbc_hs()
93 (uint8_t *)jwe->jws.map_b64.buf[LJWE_JOSE], in lws_jwe_encrypt_rsa_aes_cbc_hs()
94 (int)jwe->jws.map_b64.len[LJWE_JOSE]); in lws_jwe_encrypt_rsa_aes_cbc_hs()
100 if (lws_genrsa_create(&rsactx, jwe->jws.jwk->e, jwe->jws.context, in lws_jwe_encrypt_rsa_aes_cbc_hs()
112 memcpy(ekey, jwe->jws.map.buf[LJWE_EKEY], (unsigned int)hlen); in lws_jwe_encrypt_rsa_aes_cbc_hs()
115 (uint8_t *)jwe->jws.map.buf[LJWE_EKEY]); in lws_jwe_encrypt_rsa_aes_cbc_hs()
122 jwe->jws.map.len[LJWE_EKEY] = (unsigned int)n; /* update to encrypted EKEY size */ in lws_jwe_encrypt_rsa_aes_cbc_hs()
139 if (jwe->jws.jwk->kty != LWS_GENCRYPTO_KTY_RSA) { in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()
140 lwsl_err("%s: unexpected kty %d\n", __func__, jwe->jws.jwk->kty); in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()
145 if (jwe->jws.map.len[LJWE_EKEY] < 40) { in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()
147 jwe->jws.map.len[LJWE_EKEY]); in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()
154 if (lws_genrsa_create(&rsactx, jwe->jws.jwk->e, jwe->jws.context, in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()
164 (uint8_t *)jwe->jws.map.buf[LJWE_EKEY], in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()
165 jwe->jws.map.len[LJWE_EKEY], enc_cek, in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()
174 (uint8_t *)jwe->jws.map_b64.buf[LJWE_JOSE], in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()
175 (int)jwe->jws.map_b64.len[LJWE_JOSE]); in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()
186 n = jwe->jws.map.buf[LJWE_CTXT][jwe->jws.map.len[LJWE_CTXT] - 1]; in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()
189 (int)jwe->jws.map.len[LJWE_CTXT]); in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()
192 jwe->jws.map.len[LJWE_CTXT] -= n; in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()
195 return (int)jwe->jws.map.len[LJWE_CTXT]; in lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs()