mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
jwk: openssl: fix key parameter ordering for older OpenSSL
This commit is contained in:
parent
658afbc658
commit
e7aacc8510
2 changed files with 3 additions and 3 deletions
|
@ -100,7 +100,7 @@ lws_jwe_encrypt_rsa_aes_cbc_hs(struct lws_jwe *jwe,
|
||||||
!strcmp(jwe->jose.alg->alg, "RSA-OAEP") ?
|
!strcmp(jwe->jose.alg->alg, "RSA-OAEP") ?
|
||||||
LGRSAM_PKCS1_OAEP_PSS : LGRSAM_PKCS1_1_5,
|
LGRSAM_PKCS1_OAEP_PSS : LGRSAM_PKCS1_1_5,
|
||||||
LWS_GENHASH_TYPE_UNKNOWN)) {
|
LWS_GENHASH_TYPE_UNKNOWN)) {
|
||||||
lwsl_notice("%s: lws_genrsa_public_decrypt_create\n",
|
lwsl_notice("%s: lws_genrsa_create\n",
|
||||||
__func__);
|
__func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ lws_jwe_encrypt_rsa_aes_cbc_hs(struct lws_jwe *jwe,
|
||||||
lws_genrsa_destroy(&rsactx);
|
lws_genrsa_destroy(&rsactx);
|
||||||
lws_explicit_bzero(ekey, hlen); /* cleanse the temp CEK copy */
|
lws_explicit_bzero(ekey, hlen); /* cleanse the temp CEK copy */
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
lwsl_err("%s: decrypt cek fail\n", __func__);
|
lwsl_err("%s: encrypt cek fail\n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
jwe->jws.map.len[LJWE_EKEY] = n; /* update to encrypted EKEY size */
|
jwe->jws.map.len[LJWE_EKEY] = n; /* update to encrypted EKEY size */
|
||||||
|
|
|
@ -184,7 +184,7 @@ lws_genrsa_new_keypair(struct lws_context *context, struct lws_genrsa_ctx *ctx,
|
||||||
&mpi[LWS_GENCRYPTO_RSA_KEYEL_Q]);
|
&mpi[LWS_GENCRYPTO_RSA_KEYEL_Q]);
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
BIGNUM *mpi[5] = { ctx->rsa->n, ctx->rsa->e, ctx->rsa->d,
|
BIGNUM *mpi[5] = { ctx->rsa->e, ctx->rsa->n, ctx->rsa->d,
|
||||||
ctx->rsa->p, ctx->rsa->q, };
|
ctx->rsa->p, ctx->rsa->q, };
|
||||||
#endif
|
#endif
|
||||||
for (n = 0; n < 5; n++)
|
for (n = 0; n < 5; n++)
|
||||||
|
|
Loading…
Add table
Reference in a new issue