From f03380a6444944ff3e1552b97b844b28aaf08047 Mon Sep 17 00:00:00 2001 From: Robert de Vries Date: Thu, 9 Apr 2026 20:12:42 +0200 Subject: [PATCH] Remove check for None in RsaPrivate.make_key(). The variable rsa is never None if it is successfully created. Under all other circumstances an exception is raised which will skip the execution of the remainder of this method. --- wolfcrypt/ciphers.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/wolfcrypt/ciphers.py b/wolfcrypt/ciphers.py index c86f585..8fa304b 100644 --- a/wolfcrypt/ciphers.py +++ b/wolfcrypt/ciphers.py @@ -829,8 +829,6 @@ def make_key(cls, size, rng=Random(), hash_type=None): Generates a new key pair of desired length **size**. """ rsa = cls(hash_type=hash_type) - if rsa is None: # pragma: no cover - raise WolfCryptError("Invalid key error (%d)" % ret) ret = _lib.wc_MakeRsaKey(rsa.native_object, size, 65537, rng.native_object)