summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-10-26 14:40:17 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-10-26 14:40:17 +0000
commit36228f90b021ded96f5362b27b331c14c2c31392 (patch)
tree50390482fd5fb44e0b9f410088962db76e49ba5b
parente56e854053b4585ed1c4afafcdd159eaed64c538 (diff)
d2i_ECPrivateKey: move the version setting where it belongs
-rw-r--r--lib/libcrypto/ec/ec_asn1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcrypto/ec/ec_asn1.c b/lib/libcrypto/ec/ec_asn1.c
index 18e2e050f2a..1ea579a83b3 100644
--- a/lib/libcrypto/ec/ec_asn1.c
+++ b/lib/libcrypto/ec/ec_asn1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_asn1.c,v 1.82 2024/10/26 14:35:32 tb Exp $ */
+/* $OpenBSD: ec_asn1.c,v 1.83 2024/10/26 14:40:16 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
@@ -1105,6 +1105,7 @@ d2i_ECPrivateKey(EC_KEY **out_ec_key, const unsigned char **in, long len)
goto err;
}
+ ec_key->version = ec_privatekey->version;
if (ec_privatekey->parameters) {
EC_GROUP_free(ec_key->group);
ec_key->group = ec_asn1_pkparameters2group(ec_privatekey->parameters);
@@ -1113,7 +1114,6 @@ d2i_ECPrivateKey(EC_KEY **out_ec_key, const unsigned char **in, long len)
ECerror(ERR_R_EC_LIB);
goto err;
}
- ec_key->version = ec_privatekey->version;
if (ec_privatekey->privateKey) {
ec_key->priv_key = BN_bin2bn(