commit | ac4cd362973e9cf57c3aaf0857260950757af461 | [log] [tgz] |
---|---|---|
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | Wed Aug 14 20:20:41 2013 +0200 |
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | Tue Aug 20 20:46:04 2013 +0200 |
tree | 1c814937d1dc7fb204e89a8b6015550436af688d | |
parent | 15699380e59253223604ffa5183292dc03321aa5 [diff] [blame] |
PK rsa_verify: check signature length
diff --git a/library/pk_wrap.c b/library/pk_wrap.c index e2c9bb1..8f61500 100644 --- a/library/pk_wrap.c +++ b/library/pk_wrap.c
@@ -62,7 +62,8 @@ const unsigned char *hash, const md_info_t *md_info, const unsigned char *sig, size_t sig_len ) { - ((void) sig_len); + if( sig_len != ((rsa_context *) ctx)->len ) + return( POLARSSL_ERR_RSA_VERIFY_FAILED ); return( rsa_pkcs1_verify( (rsa_context *) ctx, RSA_PUBLIC, md_info->type, 0, hash, sig ) );