mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-24 19:01:06 +00:00
Merge branch 'pr_1045' into mbedtls-1.3
This commit is contained in:
commit
4905e6c4e7
|
@ -37,6 +37,7 @@ Bugfix
|
|||
POLARSSL_SSL_DISABLE_RENEGOTIATION is set. Found by erja-gp.
|
||||
* Add a check for invalid private parameters in ecdsa_sign.
|
||||
Reported by Yolan Romailler.
|
||||
* Fix word size check in in pk.c to not depend on MBEDTLS_HAVE_INT64.
|
||||
|
||||
Changes
|
||||
* Extend cert_write example program by options to set the CRT version
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
#include "polarssl/pk.h"
|
||||
#include "polarssl/pk_wrap.h"
|
||||
|
||||
#include "polarssl/bignum.h"
|
||||
|
||||
#if defined(POLARSSL_RSA_C)
|
||||
#include "polarssl/rsa.h"
|
||||
#endif
|
||||
|
@ -43,6 +41,7 @@
|
|||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/* Implementation that should never be optimized out by the compiler */
|
||||
static void polarssl_zeroize( void *v, size_t n ) {
|
||||
|
@ -212,10 +211,10 @@ int pk_verify_ext( pk_type_t type, const void *options,
|
|||
int ret;
|
||||
const pk_rsassa_pss_options *pss_opts;
|
||||
|
||||
#if defined(POLARSSL_HAVE_INT64)
|
||||
#if SIZE_MAX > UINT_MAX
|
||||
if( md_alg == POLARSSL_MD_NONE && UINT_MAX < hash_len )
|
||||
return( POLARSSL_ERR_PK_BAD_INPUT_DATA );
|
||||
#endif /* POLARSSL_HAVE_INT64 */
|
||||
#endif /* SIZE_MAX > UINT_MAX */
|
||||
|
||||
if( options == NULL )
|
||||
return( POLARSSL_ERR_PK_BAD_INPUT_DATA );
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
|
||||
/* Even if RSA not activated, for the sake of RSA-alt */
|
||||
#include "polarssl/rsa.h"
|
||||
#include "polarssl/bignum.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
@ -52,6 +51,7 @@
|
|||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/* Implementation that should never be optimized out by the compiler */
|
||||
static void polarssl_zeroize( void *v, size_t n ) {
|
||||
|
@ -76,10 +76,10 @@ static int rsa_verify_wrap( void *ctx, md_type_t md_alg,
|
|||
{
|
||||
int ret;
|
||||
|
||||
#if defined(POLARSSL_HAVE_INT64)
|
||||
#if SIZE_MAX > UINT_MAX
|
||||
if( md_alg == POLARSSL_MD_NONE && UINT_MAX < hash_len )
|
||||
return( POLARSSL_ERR_PK_BAD_INPUT_DATA );
|
||||
#endif /* POLARSSL_HAVE_INT64 */
|
||||
#endif /* SIZE_MAX > UINT_MAX */
|
||||
|
||||
if( sig_len < ((rsa_context *) ctx)->len )
|
||||
return( POLARSSL_ERR_RSA_VERIFY_FAILED );
|
||||
|
@ -100,10 +100,10 @@ static int rsa_sign_wrap( void *ctx, md_type_t md_alg,
|
|||
unsigned char *sig, size_t *sig_len,
|
||||
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng )
|
||||
{
|
||||
#if defined(POLARSSL_HAVE_INT64)
|
||||
#if SIZE_MAX > UINT_MAX
|
||||
if( md_alg == POLARSSL_MD_NONE && UINT_MAX < hash_len )
|
||||
return( POLARSSL_ERR_PK_BAD_INPUT_DATA );
|
||||
#endif /* POLARSSL_HAVE_INT64 */
|
||||
#endif /* SIZE_MAX > UINT_MAX */
|
||||
|
||||
*sig_len = ((rsa_context *) ctx)->len;
|
||||
|
||||
|
@ -424,10 +424,10 @@ static int rsa_alt_sign_wrap( void *ctx, md_type_t md_alg,
|
|||
{
|
||||
rsa_alt_context *rsa_alt = (rsa_alt_context *) ctx;
|
||||
|
||||
#if defined(POLARSSL_HAVE_INT64)
|
||||
#if SIZE_MAX > UINT_MAX
|
||||
if( UINT_MAX < hash_len )
|
||||
return( POLARSSL_ERR_PK_BAD_INPUT_DATA );
|
||||
#endif /* POLARSSL_HAVE_INT64 */
|
||||
#endif /* SIZE_MAX > UINT_MAX */
|
||||
|
||||
*sig_len = rsa_alt->key_len_func( rsa_alt->key );
|
||||
|
||||
|
|
Loading…
Reference in a new issue