mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-25 17:35:37 +01:00
- Integrated SHA2 in RSA fix (patch 657:658) into 0.11 branch
This commit is contained in:
parent
ad0c491c32
commit
1569ad872e
@ -333,7 +333,7 @@ int rsa_pkcs1_decrypt( rsa_context *ctx,
|
||||
{
|
||||
int ret, ilen;
|
||||
unsigned char *p;
|
||||
unsigned char buf[512];
|
||||
unsigned char buf[1024];
|
||||
|
||||
ilen = ctx->len;
|
||||
|
||||
@ -414,6 +414,23 @@ int rsa_pkcs1_sign( rsa_context *ctx,
|
||||
nb_pad = olen - 3 - 35;
|
||||
break;
|
||||
|
||||
case SIG_RSA_SHA224:
|
||||
nb_pad = olen - 3 - 47;
|
||||
break;
|
||||
|
||||
case SIG_RSA_SHA256:
|
||||
nb_pad = olen - 3 - 51;
|
||||
break;
|
||||
|
||||
case SIG_RSA_SHA384:
|
||||
nb_pad = olen - 3 - 67;
|
||||
break;
|
||||
|
||||
case SIG_RSA_SHA512:
|
||||
nb_pad = olen - 3 - 83;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return( POLARSSL_ERR_RSA_BAD_INPUT_DATA );
|
||||
}
|
||||
@ -500,7 +517,7 @@ int rsa_pkcs1_verify( rsa_context *ctx,
|
||||
{
|
||||
int ret, len, siglen;
|
||||
unsigned char *p, c;
|
||||
unsigned char buf[512];
|
||||
unsigned char buf[1024];
|
||||
|
||||
siglen = ctx->len;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user