diff options
author | tb <> | 2018-05-18 14:19:46 +0000 |
---|---|---|
committer | tb <> | 2018-05-18 14:19:46 +0000 |
commit | e3ffb24eb2064c648f986f34ac6918a0e7163531 (patch) | |
tree | c800cd70c3031eb623addf3e21a0b87601afb47b | |
parent | 3638d4e80da3bc2851d0c5c6927203d4fef08e63 (diff) | |
download | openbsd-e3ffb24eb2064c648f986f34ac6918a0e7163531.tar.gz openbsd-e3ffb24eb2064c648f986f34ac6918a0e7163531.tar.bz2 openbsd-e3ffb24eb2064c648f986f34ac6918a0e7163531.zip |
Add const qualifiers to the X509_CRL *x and ASN1_OBJECT *obj arguments of
X509_CRL_get_ext_count(3), X509_CRL_get_ext_by_NID(3),
X509_CRL_get_ext_by_OBJ(3), X509_CRL_get_ext_by_critical(3),
X509_CRL_get_ext(3), X509_CRL_get_ext_d2i(3).
ok jsing
-rw-r--r-- | src/lib/libcrypto/x509/x509.h | 22 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_ext.c | 14 |
2 files changed, 20 insertions, 16 deletions
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index aac63ea92b..ffde40fbfc 100644 --- a/src/lib/libcrypto/x509/x509.h +++ b/src/lib/libcrypto/x509/x509.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509.h,v 1.49 2018/05/13 10:36:35 tb Exp $ */ | 1 | /* $OpenBSD: x509.h,v 1.50 2018/05/18 14:19:46 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 | * |
@@ -1149,16 +1149,20 @@ void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); | |||
1149 | int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, | 1149 | int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, |
1150 | unsigned long flags); | 1150 | unsigned long flags); |
1151 | 1151 | ||
1152 | int X509_CRL_get_ext_count(X509_CRL *x); | 1152 | int X509_CRL_get_ext_count(const X509_CRL *x); |
1153 | int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos); | 1153 | int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, |
1154 | int X509_CRL_get_ext_by_OBJ(X509_CRL *x,ASN1_OBJECT *obj,int lastpos); | 1154 | int lastpos); |
1155 | int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos); | 1155 | int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, |
1156 | X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); | 1156 | const ASN1_OBJECT *obj, int lastpos); |
1157 | int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, | ||
1158 | int lastpos); | ||
1159 | X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc); | ||
1157 | X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); | 1160 | X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); |
1158 | int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); | 1161 | int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); |
1159 | void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); | 1162 | void * X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, |
1160 | int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, | 1163 | int *idx); |
1161 | unsigned long flags); | 1164 | int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, |
1165 | int crit, unsigned long flags); | ||
1162 | 1166 | ||
1163 | int X509_REVOKED_get_ext_count(X509_REVOKED *x); | 1167 | int X509_REVOKED_get_ext_count(X509_REVOKED *x); |
1164 | int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); | 1168 | int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); |
diff --git a/src/lib/libcrypto/x509/x509_ext.c b/src/lib/libcrypto/x509/x509_ext.c index e90befaba1..a0f85426ef 100644 --- a/src/lib/libcrypto/x509/x509_ext.c +++ b/src/lib/libcrypto/x509/x509_ext.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_ext.c,v 1.9 2015/02/10 08:33:10 jsing Exp $ */ | 1 | /* $OpenBSD: x509_ext.c,v 1.10 2018/05/18 14:19:46 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 | * |
@@ -66,31 +66,31 @@ | |||
66 | #include <openssl/x509v3.h> | 66 | #include <openssl/x509v3.h> |
67 | 67 | ||
68 | int | 68 | int |
69 | X509_CRL_get_ext_count(X509_CRL *x) | 69 | X509_CRL_get_ext_count(const X509_CRL *x) |
70 | { | 70 | { |
71 | return (X509v3_get_ext_count(x->crl->extensions)); | 71 | return (X509v3_get_ext_count(x->crl->extensions)); |
72 | } | 72 | } |
73 | 73 | ||
74 | int | 74 | int |
75 | X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos) | 75 | X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos) |
76 | { | 76 | { |
77 | return (X509v3_get_ext_by_NID(x->crl->extensions, nid, lastpos)); | 77 | return (X509v3_get_ext_by_NID(x->crl->extensions, nid, lastpos)); |
78 | } | 78 | } |
79 | 79 | ||
80 | int | 80 | int |
81 | X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos) | 81 | X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj, int lastpos) |
82 | { | 82 | { |
83 | return (X509v3_get_ext_by_OBJ(x->crl->extensions, obj, lastpos)); | 83 | return (X509v3_get_ext_by_OBJ(x->crl->extensions, obj, lastpos)); |
84 | } | 84 | } |
85 | 85 | ||
86 | int | 86 | int |
87 | X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos) | 87 | X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos) |
88 | { | 88 | { |
89 | return (X509v3_get_ext_by_critical(x->crl->extensions, crit, lastpos)); | 89 | return (X509v3_get_ext_by_critical(x->crl->extensions, crit, lastpos)); |
90 | } | 90 | } |
91 | 91 | ||
92 | X509_EXTENSION * | 92 | X509_EXTENSION * |
93 | X509_CRL_get_ext(X509_CRL *x, int loc) | 93 | X509_CRL_get_ext(const X509_CRL *x, int loc) |
94 | { | 94 | { |
95 | return (X509v3_get_ext(x->crl->extensions, loc)); | 95 | return (X509v3_get_ext(x->crl->extensions, loc)); |
96 | } | 96 | } |
@@ -102,7 +102,7 @@ X509_CRL_delete_ext(X509_CRL *x, int loc) | |||
102 | } | 102 | } |
103 | 103 | ||
104 | void * | 104 | void * |
105 | X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx) | 105 | X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx) |
106 | { | 106 | { |
107 | return X509V3_get_d2i(x->crl->extensions, nid, crit, idx); | 107 | return X509V3_get_d2i(x->crl->extensions, nid, crit, idx); |
108 | } | 108 | } |