1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

Define a constant for the maximum signature size from pk_sign()

Based on the buffer size used in the pk_sign sample program, this is
MBEDTLS_MPI_MAX_SIZE.
This commit is contained in:
Gilles Peskine
2019-11-05 16:23:49 +01:00
parent 22589f0a72
commit da252bed3c
3 changed files with 14 additions and 4 deletions

View File

@@ -70,7 +70,7 @@ int main( int argc, char *argv[] )
mbedtls_entropy_context entropy;
mbedtls_ctr_drbg_context ctr_drbg;
unsigned char hash[32];
unsigned char buf[MBEDTLS_MPI_MAX_SIZE];
unsigned char buf[MBEDTLS_PK_SIGNATURE_MAX_SIZE];
char filename[512];
const char *pers = "mbedtls_pk_sign";
size_t olen = 0;

View File

@@ -65,7 +65,7 @@ int main( int argc, char *argv[] )
size_t i;
mbedtls_pk_context pk;
unsigned char hash[32];
unsigned char buf[MBEDTLS_MPI_MAX_SIZE];
unsigned char buf[MBEDTLS_PK_SIGNATURE_MAX_SIZE];
char filename[512];
mbedtls_pk_init( &pk );