summaryrefslogtreecommitdiffstats
path: root/crypto/objects/obj_dat.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-06-26 16:16:56 +0200
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-08-04 09:17:47 +0200
commitb516a4b1399328ed2177e6bc5f717416a7d03806 (patch)
treeabfa71f4475ca9c70f8803db17c991346f8c3c10 /crypto/objects/obj_dat.c
parentapps/cmp.c: Defer diagnostic output on server+proxy to be contacted (diff)
downloadopenssl-b516a4b1399328ed2177e6bc5f717416a7d03806.tar.xz
openssl-b516a4b1399328ed2177e6bc5f717416a7d03806.zip
Correct misleading diagnostics of OBJ_txt2obj on unknown object name
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12296)
Diffstat (limited to 'crypto/objects/obj_dat.c')
-rw-r--r--crypto/objects/obj_dat.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c
index 0c4ec985cb..b2fd4a0226 100644
--- a/crypto/objects/obj_dat.c
+++ b/crypto/objects/obj_dat.c
@@ -372,6 +372,10 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
if (((nid = OBJ_sn2nid(s)) != NID_undef) ||
((nid = OBJ_ln2nid(s)) != NID_undef))
return OBJ_nid2obj(nid);
+ if (!ossl_isdigit(*s)) {
+ OBJerr(OBJ_F_OBJ_TXT2OBJ, OBJ_R_UNKNOWN_OBJECT_NAME);
+ return NULL;
+ }
}
/* Work out size of content octets */