mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
gencrypto: mbedtls: manual rsa padding removal only needed on old mbedtls in optee
This commit is contained in:
parent
aada7348ea
commit
63ad616941
1 changed files with 7 additions and 1 deletions
|
@ -178,12 +178,18 @@ lws_jwe_auth_and_decrypt_rsa_aes_cbc_hs(struct lws_jwe *jwe)
|
|||
return -1;
|
||||
}
|
||||
|
||||
#if defined(LWS_WITH_MBEDTLS) && defined(LWS_PLAT_OPTEE)
|
||||
|
||||
/* strip padding */
|
||||
|
||||
n = jwe->jws.map.buf[LJWE_CTXT][jwe->jws.map.len[LJWE_CTXT] - 1];
|
||||
if (n > 16)
|
||||
if (n > 16) {
|
||||
lwsl_err("%s: n == %d, plen %d\n", __func__, n,
|
||||
(int)jwe->jws.map.len[LJWE_CTXT]);
|
||||
return -1;
|
||||
}
|
||||
jwe->jws.map.len[LJWE_CTXT] -= n;
|
||||
#endif
|
||||
|
||||
return jwe->jws.map.len[LJWE_CTXT];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue