mirror of
https://github.com/cuberite/polarssl.git
synced 2025-10-03 10:34:16 -04:00
Changing buffer size checks.
Signed-off-by: pespacek <peter.spacek@silabs.com>
This commit is contained in:
parent
3110c7b340
commit
b9f07a79a7
@ -47,7 +47,6 @@
|
|||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||||
#include "psa/crypto.h"
|
#include "psa/crypto.h"
|
||||||
#include "mbedtls/psa_util.h"
|
#include "mbedtls/psa_util.h"
|
||||||
#include "psa/crypto_values.h"
|
|
||||||
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
||||||
|
|
||||||
#if defined(MBEDTLS_PLATFORM_C)
|
#if defined(MBEDTLS_PLATFORM_C)
|
||||||
@ -2382,7 +2381,8 @@ static int x509_crt_verifycrl( mbedtls_x509_crt *crt, mbedtls_x509_crt *ca,
|
|||||||
if(psa_hash_compute( psa_algorithm,
|
if(psa_hash_compute( psa_algorithm,
|
||||||
crl_list->tbs.p,
|
crl_list->tbs.p,
|
||||||
crl_list->tbs.len,
|
crl_list->tbs.len,
|
||||||
hash,PSA_HASH_MAX_SIZE,
|
hash,
|
||||||
|
sizeof( hash ),
|
||||||
&hash_length ) != PSA_SUCCESS )
|
&hash_length ) != PSA_SUCCESS )
|
||||||
#else
|
#else
|
||||||
md_info = mbedtls_md_info_from_type( crl_list->sig_md );
|
md_info = mbedtls_md_info_from_type( crl_list->sig_md );
|
||||||
@ -2460,7 +2460,7 @@ static int x509_crt_check_signature( const mbedtls_x509_crt *child,
|
|||||||
child->tbs.p,
|
child->tbs.p,
|
||||||
child->tbs.len,
|
child->tbs.len,
|
||||||
hash,
|
hash,
|
||||||
PSA_HASH_MAX_SIZE,
|
sizeof( hash ),
|
||||||
&hash_len );
|
&hash_len );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
|
@ -236,9 +236,9 @@ int mbedtls_x509write_crt_set_authority_key_identifier( mbedtls_x509write_cert *
|
|||||||
mbedtls_pk_write_pubkey( &c, buf, ctx->issuer_key ) );
|
mbedtls_pk_write_pubkey( &c, buf, ctx->issuer_key ) );
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||||
status = psa_hash_compute( PSA_ALG_SHA_1,
|
status = psa_hash_compute( PSA_ALG_SHA_1,
|
||||||
buf + sizeof( buf ) - len,
|
buf + sizeof(buf) - len,
|
||||||
len,
|
len,
|
||||||
buf + sizeof( buf ) - 20 ,
|
buf + sizeof(buf) - 20,
|
||||||
PSA_HASH_LENGTH(PSA_ALG_SHA_1),
|
PSA_HASH_LENGTH(PSA_ALG_SHA_1),
|
||||||
&hash_length );
|
&hash_length );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
@ -523,7 +523,7 @@ int mbedtls_x509write_crt_der( mbedtls_x509write_cert *ctx,
|
|||||||
c,
|
c,
|
||||||
len,
|
len,
|
||||||
hash,
|
hash,
|
||||||
PSA_HASH_MAX_SIZE,
|
sizeof( hash ),
|
||||||
&hash_length );
|
&hash_length );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
|
@ -222,7 +222,7 @@ static int x509write_csr_der_internal( mbedtls_x509write_csr *ctx,
|
|||||||
c,
|
c,
|
||||||
len,
|
len,
|
||||||
hash,
|
hash,
|
||||||
PSA_HASH_MAX_SIZE,
|
sizeof( hash ),
|
||||||
&hash_len ) != PSA_SUCCESS )
|
&hash_len ) != PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
return ( MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED );
|
return ( MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user