Fix: yaca_key_derive_dh() different parameters error 51/82951/3
authorDariusz Michaluk <d.michaluk@samsung.com>
Mon, 8 Aug 2016 08:45:19 +0000 (10:45 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 10 Aug 2016 14:51:57 +0000 (07:51 -0700)
Change-Id: Ia13fae08c15aa134c1fd84e3ae33e9a7f89d421c

src/debug.c
src/key.c

index 7f9d470c65d9f8367d237957aee793047fa2a0b3..0dbed343cf527a71231eb8139faedcf7c6d32523 100644 (file)
@@ -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):
index 136a33365dc20f94cf1618a1dae8385e721dda03..a79010cd1f1599272fe97d749fb849160d7ea660 100644 (file)
--- 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;
        }