1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-12-24 17:41:01 +03:00

Added missing MPI_CHK around mpi functions

This commit is contained in:
Paul Bakker
2014-04-17 12:42:41 +02:00
parent a9c16d2825
commit 3d8fb63e11
5 changed files with 27 additions and 21 deletions

View File

@@ -109,7 +109,7 @@ int asn1_write_mpi( unsigned char **p, unsigned char *start, mpi *X )
return( POLARSSL_ERR_ASN1_BUF_TOO_SMALL );
(*p) -= len;
mpi_write_binary( X, *p, len );
MPI_CHK( mpi_write_binary( X, *p, len ) );
// DER format assumes 2s complement for numbers, so the leftmost bit
// should be 0 for positive numbers and 1 for negative numbers.
@@ -126,7 +126,10 @@ int asn1_write_mpi( unsigned char **p, unsigned char *start, mpi *X )
ASN1_CHK_ADD( len, asn1_write_len( p, start, len ) );
ASN1_CHK_ADD( len, asn1_write_tag( p, start, ASN1_INTEGER ) );
return( (int) len );
ret = (int) len;
cleanup:
return( ret );
}
#endif /* POLARSSL_BIGNUM_C */