From dee65c8036f43094dc2573a9be0e08240fdc62f5 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 9 Jan 2022 17:49:42 +0100 Subject: [PATCH] recover_pk: better warning if OpenSSL doesn't provide required curve (Fedora I'm looking at you) cf https://bugzilla.redhat.com/show_bug.cgi?id=1019390#c25 --- tools/recover_pk.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/recover_pk.py b/tools/recover_pk.py index 470f406ae..8f1f19140 100755 --- a/tools/recover_pk.py +++ b/tools/recover_pk.py @@ -34,7 +34,11 @@ def guess_curvename(signature): def recover(data, signature, curvename, alghash=None): recovered = set() - curve = sslcrypto.ecc.get_curve(curvename) + try: + curve = sslcrypto.ecc.get_curve(curvename) + except ValueError: + print("Warning, your OpenSSL doesn't provide support for curve", curvename) + return recovered recoverable = len(signature) % 1 == 1 if (recoverable): try: