Merge remote-tracking branch 'restricted/pr/573' into development-restricted
* restricted/pr/573: Remove redundant config.pl call Add a test for signing content with a long ECDSA key Add documentation notes about the required size of the signature buffers Add missing MBEDTLS_ECP_C dependencies in check_config.h Change size of preallocated buffer for pk_sign() calls
This commit is contained in:
commit
bd3a7464b7
9 changed files with 76 additions and 8 deletions
|
@ -61,6 +61,16 @@ int main( void )
|
|||
#include <string.h>
|
||||
|
||||
|
||||
/*
|
||||
* For the currently used signature algorithms the buffer to store any signature
|
||||
* must be at least of size MAX(MBEDTLS_ECDSA_MAX_LEN, MBEDTLS_MPI_MAX_SIZE)
|
||||
*/
|
||||
#if MBEDTLS_ECDSA_MAX_LEN > MBEDTLS_MPI_MAX_SIZE
|
||||
#define SIGNATURE_MAX_SIZE MBEDTLS_ECDSA_MAX_LEN
|
||||
#else
|
||||
#define SIGNATURE_MAX_SIZE MBEDTLS_MPI_MAX_SIZE
|
||||
#endif
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
FILE *f;
|
||||
|
@ -70,7 +80,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[SIGNATURE_MAX_SIZE];
|
||||
char filename[512];
|
||||
const char *pers = "mbedtls_pk_sign";
|
||||
size_t olen = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue