From: tb Date: Wed, 15 Mar 2023 06:34:07 +0000 (+0000) Subject: Return the signature length after successful signing operation X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=249ad34f4f2742616a5deb79bbaf826edd907d88;p=openbsd Return the signature length after successful signing operation This is required behavior of the EVP_DigestSign() API, but seemingly almost nothing uses this. Well, turns out ldns does. Reported by Stephane. Helpful comments by sthen. ok jsing --- diff --git a/lib/libcrypto/ec/ecx_methods.c b/lib/libcrypto/ec/ecx_methods.c index 26fef183817..8510d1a4710 100644 --- a/lib/libcrypto/ec/ecx_methods.c +++ b/lib/libcrypto/ec/ecx_methods.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecx_methods.c,v 1.4 2022/11/26 16:08:52 tb Exp $ */ +/* $OpenBSD: ecx_methods.c,v 1.5 2023/03/15 06:34:07 tb Exp $ */ /* * Copyright (c) 2022 Joel Sing * @@ -741,6 +741,8 @@ pkey_ecx_digestsign(EVP_MD_CTX *md_ctx, unsigned char *out_sig, ecx_key->priv_key)) return 0; + *out_sig_len = ecx_sig_size(pkey_ctx->pkey); + return 1; }