1
0
Fork 0
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:
Andy Green 2019-01-30 07:19:38 +08:00
parent 658afbc658
commit e7aacc8510
2 changed files with 3 additions and 3 deletions

View file

@ -100,7 +100,7 @@ lws_jwe_encrypt_rsa_aes_cbc_hs(struct lws_jwe *jwe,
!strcmp(jwe->jose.alg->alg, "RSA-OAEP") ?
LGRSAM_PKCS1_OAEP_PSS : LGRSAM_PKCS1_1_5,
LWS_GENHASH_TYPE_UNKNOWN)) {
lwsl_notice("%s: lws_genrsa_public_decrypt_create\n",
lwsl_notice("%s: lws_genrsa_create\n",
__func__);
return -1;
}
@ -115,7 +115,7 @@ lws_jwe_encrypt_rsa_aes_cbc_hs(struct lws_jwe *jwe,
lws_genrsa_destroy(&rsactx);
lws_explicit_bzero(ekey, hlen); /* cleanse the temp CEK copy */
if (n < 0) {
lwsl_err("%s: decrypt cek fail\n", __func__);
lwsl_err("%s: encrypt cek fail\n", __func__);
return -1;
}
jwe->jws.map.len[LJWE_EKEY] = n; /* update to encrypted EKEY size */

View file

@ -184,7 +184,7 @@ lws_genrsa_new_keypair(struct lws_context *context, struct lws_genrsa_ctx *ctx,
&mpi[LWS_GENCRYPTO_RSA_KEYEL_Q]);
#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, };
#endif
for (n = 0; n < 5; n++)