]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[crypto] Fix identification of non-wrapped elliptic curve identifiers
authorMichael Brown <mcb30@ipxe.org>
Mon, 22 Dec 2025 16:13:21 +0000 (16:13 +0000)
committerMichael Brown <mcb30@ipxe.org>
Mon, 22 Dec 2025 16:14:06 +0000 (16:14 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/crypto/asn1.c

index 21029f6f62e6a09cd9b18079374de7a7ee8835d6..dd0b954e1c800f4caeb48919ae9d485a77394273 100644 (file)
@@ -667,8 +667,8 @@ int asn1_curve_algorithm ( const struct asn1_cursor *cursor,
         *
         * - a standalone object identifier for the curve
         */
-       if ( wrapper && asn1_check_algorithm ( cursor, wrapper,
-                                              &curve ) != 0 ) {
+       if ( ( wrapper == NULL ) ||
+            ( asn1_check_algorithm ( cursor, wrapper, &curve ) != 0 ) ) {
                memcpy ( &curve, cursor, sizeof ( curve ) );
        }