From 8ce9f4e4f728eb601e4e1435956ebaa987029b95 Mon Sep 17 00:00:00 2001 From: Krzysztof Jackiewicz Date: Wed, 7 Apr 2021 23:04:57 +0200 Subject: [PATCH] Adjust to openssl 1.1.1j padding changes The SSL v2.3 padding has been modified in recent openssl 1.1.1j. PKCS1 and PKCS1 SSLv2.3 are now compatible both ways but this is not what our test expects. The test has been adjusted. Change-Id: I961345ac7f1864f4b768521c7814eac5b293fbd9 --- src/yaca/yaca-test-rsa.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/yaca/yaca-test-rsa.cpp b/src/yaca/yaca-test-rsa.cpp index 4bc7b21..93c41c9 100644 --- a/src/yaca/yaca-test-rsa.cpp +++ b/src/yaca/yaca-test-rsa.cpp @@ -187,14 +187,13 @@ void test_rsa_padding(const KeyPair& kp, const PaddingInfo& pi, EncryptionType e continue; /* - * - YACA_PADDING_PKCS1 & YACA_PADDING_PKCS1_SSLV23 are compatible in case of - * public_encrypt/private_decrypt + * - YACA_PADDING_PKCS1 & YACA_PADDING_PKCS1_SSLV23 are compatible * - YACA_PADDING_NONE checks only the input length */ expected = YACA_ERROR_INVALID_PARAMETER; if (p.padding == YACA_PADDING_NONE || - (et == ET_PUB && ((p.padding == YACA_PADDING_PKCS1 && padding == YACA_PADDING_PKCS1_SSLV23) || - (p.padding == padding)))) + (p.padding == YACA_PADDING_PKCS1 && padding == YACA_PADDING_PKCS1_SSLV23) || + (p.padding == YACA_PADDING_PKCS1_SSLV23 && padding == YACA_PADDING_PKCS1)) expected = YACA_ERROR_NONE; int ret = decrypt(p.padding, dec_key.get(), -- 2.7.4