small change in error handling
This commit is contained in:
parent
ddb1274596
commit
e4a4226f5d
1 changed files with 9 additions and 9 deletions
|
@ -82,17 +82,17 @@ int libp2p_crypto_encoding_x509_der_to_private_key(unsigned char* der, size_t de
|
|||
private_key->P = *(rsa->P.p);
|
||||
private_key->Q = *(rsa->Q.p);
|
||||
private_key->QP = *(rsa->QP.p);
|
||||
|
||||
// now put the public DER format in.
|
||||
private_key->der = malloc(sizeof(char) * der_length);
|
||||
if (private_key->der == NULL)
|
||||
return 0;
|
||||
memcpy(private_key->der, der, der_length);
|
||||
private_key->der_length = der_length;
|
||||
|
||||
//NOTE: the public DER stuff is done in rsa.c
|
||||
}
|
||||
|
||||
// now put the public DER format in.
|
||||
private_key->der = malloc(sizeof(char) * der_length);
|
||||
if (private_key->der == NULL)
|
||||
return 0;
|
||||
memcpy(private_key->der, der, der_length);
|
||||
private_key->der_length = der_length;
|
||||
|
||||
//NOTE: the public DER stuff is done in rsa.c
|
||||
|
||||
mbedtls_pk_free(&ctx);
|
||||
|
||||
return retVal >= 0;
|
||||
|
|
Loading…
Reference in a new issue