'version' is not optional in the encoding
authorBodo Möller <bodo@openssl.org>
Wed, 17 Apr 2002 11:35:52 +0000 (11:35 +0000)
committerBodo Möller <bodo@openssl.org>
Wed, 17 Apr 2002 11:35:52 +0000 (11:35 +0000)
Submitted by: Nils Larsch

crypto/ecdsa/ecs_asn1.c

index 0b2baf7..0789915 100644 (file)
@@ -261,14 +261,9 @@ X9_62_EC_PARAMETERS *ECDSA_get_X9_62_EC_PARAMETERS(const ECDSA *ecdsa, X9_62_EC_
        }
        else
                ret = param;
        }
        else
                ret = param;
-       if (ecdsa->version == 1)
-               ret->version = NULL;
-       else
-       {
-               if (ret->version == NULL && (ret->version = ASN1_INTEGER_new()) == NULL)
-                       OPENSSL_ECDSA_ABORT(ERR_R_MALLOC_FAILURE)
-               if (!ASN1_INTEGER_set(ret->version, (long)ecdsa->version)) goto err;
-       }
+       if (ret->version == NULL && (ret->version = ASN1_INTEGER_new()) == NULL)
+               OPENSSL_ECDSA_ABORT(ERR_R_MALLOC_FAILURE)
+       if (!ASN1_INTEGER_set(ret->version, (long)ecdsa->version)) goto err;
        if ((ret->fieldID = ECDSA_get_X9_62_FIELDID(ecdsa, ret->fieldID)) == NULL)
                OPENSSL_ECDSA_ABORT(ECDSA_R_ECDSA_GET_X9_62_FIELDID_FAILURE)
        if ((ret->curve = ECDSA_get_X9_62_CURVE(ecdsa, ret->curve)) == NULL)
        if ((ret->fieldID = ECDSA_get_X9_62_FIELDID(ecdsa, ret->fieldID)) == NULL)
                OPENSSL_ECDSA_ABORT(ECDSA_R_ECDSA_GET_X9_62_FIELDID_FAILURE)
        if ((ret->curve = ECDSA_get_X9_62_CURVE(ecdsa, ret->curve)) == NULL)