summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2024-05-23 01:43:51 +0000
committertb <>2024-05-23 01:43:51 +0000
commit2190ce157211f4175ec813e7cee5d80cca31e931 (patch)
treebcac689a8d9db26e3a86ba8ba822ac6d3f2a3573 /src/lib
parent85466f7da48e5a7bda345f5e905e8d3eaa70617a (diff)
downloadopenbsd-2190ce157211f4175ec813e7cee5d80cca31e931.tar.gz
openbsd-2190ce157211f4175ec813e7cee5d80cca31e931.tar.bz2
openbsd-2190ce157211f4175ec813e7cee5d80cca31e931.zip
X509v3_get_ext_by_NID: make obj const, test & assign
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/x509/x509_v3.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509/x509_v3.c b/src/lib/libcrypto/x509/x509_v3.c
index 3666d24c07..2d122fd7a5 100644
--- a/src/lib/libcrypto/x509/x509_v3.c
+++ b/src/lib/libcrypto/x509/x509_v3.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_v3.c,v 1.24 2024/05/23 01:42:23 tb Exp $ */ 1/* $OpenBSD: x509_v3.c,v 1.25 2024/05/23 01:43:51 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -80,11 +80,11 @@ LCRYPTO_ALIAS(X509v3_get_ext_count);
80int 80int
81X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid, int lastpos) 81X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid, int lastpos)
82{ 82{
83 ASN1_OBJECT *obj; 83 const ASN1_OBJECT *obj;
84 84
85 obj = OBJ_nid2obj(nid); 85 if ((obj = OBJ_nid2obj(nid)) == NULL)
86 if (obj == NULL)
87 return -2; 86 return -2;
87
88 return X509v3_get_ext_by_OBJ(x, obj, lastpos); 88 return X509v3_get_ext_by_OBJ(x, obj, lastpos);
89} 89}
90LCRYPTO_ALIAS(X509v3_get_ext_by_NID); 90LCRYPTO_ALIAS(X509v3_get_ext_by_NID);