aboutsummaryrefslogtreecommitdiff
path: root/crypto/ec/ec_err.c
diff options
context:
space:
mode:
authorNicola Tuveri <nic.tuv@gmail.com>2020-06-29 00:53:46 +0300
committerNicola Tuveri <nic.tuv@gmail.com>2020-07-06 19:15:36 +0300
commite0137ca92b4abf65acde15b255ae58d7e76af22f (patch)
treec12f559221429f52e08a5df2f6c167a1127aabcb /crypto/ec/ec_err.c
parent8c330e1939d6b7db93a963116354ef80ca0babb3 (diff)
downloadopenssl-e0137ca92b4abf65acde15b255ae58d7e76af22f.zip
openssl-e0137ca92b4abf65acde15b255ae58d7e76af22f.tar.gz
openssl-e0137ca92b4abf65acde15b255ae58d7e76af22f.tar.bz2
[EC][ASN1] Detect missing OID when serializing EC parameters and keys
The following built-in curves do not have an assigned OID: - Oakley-EC2N-3 - Oakley-EC2N-4 In general we shouldn't assume that an OID is always available. This commit detects such cases, raises an error and returns appropriate return values so that the condition can be detected and correctly handled by the callers, when serializing EC parameters or EC keys with the default `ec_param_enc:named_curve`. Fixes #12306 Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12313)
Diffstat (limited to 'crypto/ec/ec_err.c')
-rw-r--r--crypto/ec/ec_err.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/ec/ec_err.c b/crypto/ec/ec_err.c
index d775ced..afb2696 100644
--- a/crypto/ec/ec_err.c
+++ b/crypto/ec/ec_err.c
@@ -70,6 +70,7 @@ static const ERR_STRING_DATA EC_str_reasons[] = {
{ERR_PACK(ERR_LIB_EC, 0, EC_R_LADDER_POST_FAILURE), "ladder post failure"},
{ERR_PACK(ERR_LIB_EC, 0, EC_R_LADDER_PRE_FAILURE), "ladder pre failure"},
{ERR_PACK(ERR_LIB_EC, 0, EC_R_LADDER_STEP_FAILURE), "ladder step failure"},
+ {ERR_PACK(ERR_LIB_EC, 0, EC_R_MISSING_OID), "missing OID"},
{ERR_PACK(ERR_LIB_EC, 0, EC_R_MISSING_PARAMETERS), "missing parameters"},
{ERR_PACK(ERR_LIB_EC, 0, EC_R_MISSING_PRIVATE_KEY), "missing private key"},
{ERR_PACK(ERR_LIB_EC, 0, EC_R_NEED_NEW_SETUP_VALUES),