aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/ecc_key/ecc_key.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-12-19 14:19:32 -0500
committerJack Lloyd <[email protected]>2017-12-19 14:19:32 -0500
commit1d728d6192a909e150bf2d9f89c1efbd70f51512 (patch)
treeb944364910370dcd3f0a631a2d5a0d43dbd0b1ef /src/lib/pubkey/ecc_key/ecc_key.cpp
parent4ad5acf4e038f5dd296b0ac82922a1f2e3880324 (diff)
parentf19ab7155d746fde5ce8b811576abb5a6ee0ff28 (diff)
Merge GH #1365 Always set domain encoding correctly when loading an ECC key
Diffstat (limited to 'src/lib/pubkey/ecc_key/ecc_key.cpp')
-rw-r--r--src/lib/pubkey/ecc_key/ecc_key.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/pubkey/ecc_key/ecc_key.cpp b/src/lib/pubkey/ecc_key/ecc_key.cpp
index 442fb41d2..34062c362 100644
--- a/src/lib/pubkey/ecc_key/ecc_key.cpp
+++ b/src/lib/pubkey/ecc_key/ecc_key.cpp
@@ -165,6 +165,11 @@ EC_PrivateKey::EC_PrivateKey(const AlgorithmIdentifier& alg_id,
m_domain_params = EC_Group(alg_id.get_parameters());
m_domain_encoding = EC_DOMPAR_ENC_EXPLICIT;
+ if (!domain().get_oid().empty())
+ m_domain_encoding = EC_DOMPAR_ENC_OID;
+ else
+ m_domain_encoding = EC_DOMPAR_ENC_EXPLICIT;
+
OID key_parameters;
secure_vector<uint8_t> public_key_bits;