From ebbf8b0723c30ece0d7ae849ec182a643e1eeab0 Mon Sep 17 00:00:00 2001 From: Dariusz Michaluk Date: Mon, 8 Aug 2016 10:45:19 +0200 Subject: [PATCH] Fix: yaca_key_derive_dh() different parameters error Change-Id: Ia13fae08c15aa134c1fd84e3ae33e9a7f89d421c --- src/debug.c | 1 + src/key.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug.c b/src/debug.c index 7f9d470..0dbed34 100644 --- a/src/debug.c +++ b/src/debug.c @@ -129,6 +129,7 @@ int error_handle(const char *file, int line, const char *function) case ERR_PACK(ERR_LIB_ASN1, ASN1_F_ASN1_D2I_READ_BIO, ASN1_R_NOT_ENOUGH_DATA): case ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_ENCRYPTFINAL_EX, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH): case ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_DECRYPTFINAL_EX, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH): + case ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_PKEY_DERIVE_SET_PEER, EVP_R_DIFFERENT_PARAMETERS): ret = YACA_ERROR_INVALID_PARAMETER; break; case ERR_PACK(ERR_LIB_ASN1, ASN1_F_ASN1_GET_OBJECT, ASN1_R_TOO_LONG): diff --git a/src/key.c b/src/key.c index 136a333..a79010c 100644 --- a/src/key.c +++ b/src/key.c @@ -1782,8 +1782,7 @@ API int yaca_key_derive_dh(const yaca_key_h prv_key, ret = EVP_PKEY_derive_set_peer(ctx, lpub_key->evp); if (ret != 1) { - ret = YACA_ERROR_INTERNAL; - ERROR_DUMP(ret); + ret = ERROR_HANDLE(); goto exit; } -- 2.7.4