1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Add ecdsa_from_keypair()

Also fix bug/limitation in mpi_copy: would segfault if src just initialised
and not set to a value yet. (This case occurs when copying a context which
contains only the public part of the key, eg.)
This commit is contained in:
Manuel Pégourié-Gonnard
2013-08-12 17:02:59 +02:00
parent cc0a9d040d
commit f499993cb2
3 changed files with 30 additions and 0 deletions

View File

@ -130,6 +130,12 @@ int mpi_copy( mpi *X, const mpi *Y )
if( X == Y )
return( 0 );
if( Y->p == NULL )
{
mpi_free( X );
return( 0 );
}
for( i = Y->n - 1; i > 0; i-- )
if( Y->p[i] != 0 )
break;