From: Sebastian Andrzej Siewior Date: Mon, 1 Aug 2022 20:08:27 +0000 (+0200) Subject: test/evp_test: Test if EVP_DigestSign() set signature's length. X-Git-Tag: openssl-3.2.0-alpha1~2297 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc5888ccb60f33b366972299f30b976c4dc12162;p=thirdparty%2Fopenssl.git test/evp_test: Test if EVP_DigestSign() set signature's length. Increase the signature's length, that is passed to EVP_DigestSign(). The implementation should set this parameter back to the actual length, that has been written. This (oneshot_digestsign_test_run()) fails for the ed25519/ ed448 implementation of s390 prio the fix. The change in digestsign_test_run() follows the same pattern and is for collecting bonus points. Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Matt Caswell Reviewed-by: Todd Short (Merged from https://github.com/openssl/openssl/pull/18928) --- diff --git a/test/evp_test.c b/test/evp_test.c index 4a532bee762..403efb3e25c 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -3335,6 +3335,7 @@ static int digestsign_test_run(EVP_TEST *t) t->err = "MALLOC_FAILURE"; goto err; } + got_len *= 2; if (!EVP_DigestSignFinal(expected->ctx, got, &got_len)) { t->err = "DIGESTSIGNFINAL_ERROR"; goto err; @@ -3412,6 +3413,7 @@ static int oneshot_digestsign_test_run(EVP_TEST *t) t->err = "MALLOC_FAILURE"; goto err; } + got_len *= 2; if (!EVP_DigestSign(expected->ctx, got, &got_len, expected->osin, expected->osin_len)) { t->err = "DIGESTSIGN_ERROR";