diff options
| author | beck <> | 1999-09-29 04:37:45 +0000 |
|---|---|---|
| committer | beck <> | 1999-09-29 04:37:45 +0000 |
| commit | de8f24ea083384bb66b32ec105dc4743c5663cdf (patch) | |
| tree | 1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/x509/x509_ext.c | |
| parent | cb929d29896bcb87c2a97417fbd03e50078fc178 (diff) | |
| download | openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2 openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip | |
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/x509/x509_ext.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_ext.c | 106 |
1 files changed, 29 insertions, 77 deletions
diff --git a/src/lib/libcrypto/x509/x509_ext.c b/src/lib/libcrypto/x509/x509_ext.c index 1d76ecfcfd..f8565a60b2 100644 --- a/src/lib/libcrypto/x509/x509_ext.c +++ b/src/lib/libcrypto/x509/x509_ext.c | |||
| @@ -57,166 +57,118 @@ | |||
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include "stack.h" | 60 | #include <openssl/stack.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include "asn1.h" | 62 | #include <openssl/asn1.h> |
| 63 | #include "objects.h" | 63 | #include <openssl/objects.h> |
| 64 | #include "evp.h" | 64 | #include <openssl/evp.h> |
| 65 | #include "x509.h" | 65 | #include <openssl/x509.h> |
| 66 | 66 | ||
| 67 | int X509_CRL_get_ext_count(x) | 67 | int X509_CRL_get_ext_count(X509_CRL *x) |
| 68 | X509_CRL *x; | ||
| 69 | { | 68 | { |
| 70 | return(X509v3_get_ext_count(x->crl->extensions)); | 69 | return(X509v3_get_ext_count(x->crl->extensions)); |
| 71 | } | 70 | } |
| 72 | 71 | ||
| 73 | int X509_CRL_get_ext_by_NID(x,nid,lastpos) | 72 | int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos) |
| 74 | X509_CRL *x; | ||
| 75 | int nid; | ||
| 76 | int lastpos; | ||
| 77 | { | 73 | { |
| 78 | return(X509v3_get_ext_by_NID(x->crl->extensions,nid,lastpos)); | 74 | return(X509v3_get_ext_by_NID(x->crl->extensions,nid,lastpos)); |
| 79 | } | 75 | } |
| 80 | 76 | ||
| 81 | int X509_CRL_get_ext_by_OBJ(x,obj,lastpos) | 77 | int X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos) |
| 82 | X509_CRL *x; | ||
| 83 | ASN1_OBJECT *obj; | ||
| 84 | int lastpos; | ||
| 85 | { | 78 | { |
| 86 | return(X509v3_get_ext_by_OBJ(x->crl->extensions,obj,lastpos)); | 79 | return(X509v3_get_ext_by_OBJ(x->crl->extensions,obj,lastpos)); |
| 87 | } | 80 | } |
| 88 | 81 | ||
| 89 | int X509_CRL_get_ext_by_critical(x,crit,lastpos) | 82 | int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos) |
| 90 | X509_CRL *x; | ||
| 91 | int crit; | ||
| 92 | int lastpos; | ||
| 93 | { | 83 | { |
| 94 | return(X509v3_get_ext_by_critical(x->crl->extensions,crit,lastpos)); | 84 | return(X509v3_get_ext_by_critical(x->crl->extensions,crit,lastpos)); |
| 95 | } | 85 | } |
| 96 | 86 | ||
| 97 | X509_EXTENSION *X509_CRL_get_ext(x,loc) | 87 | X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc) |
| 98 | X509_CRL *x; | ||
| 99 | int loc; | ||
| 100 | { | 88 | { |
| 101 | return(X509v3_get_ext(x->crl->extensions,loc)); | 89 | return(X509v3_get_ext(x->crl->extensions,loc)); |
| 102 | } | 90 | } |
| 103 | 91 | ||
| 104 | X509_EXTENSION *X509_CRL_delete_ext(x,loc) | 92 | X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc) |
| 105 | X509_CRL *x; | ||
| 106 | int loc; | ||
| 107 | { | 93 | { |
| 108 | return(X509v3_delete_ext(x->crl->extensions,loc)); | 94 | return(X509v3_delete_ext(x->crl->extensions,loc)); |
| 109 | } | 95 | } |
| 110 | 96 | ||
| 111 | int X509_CRL_add_ext(x,ex,loc) | 97 | int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc) |
| 112 | X509_CRL *x; | ||
| 113 | X509_EXTENSION *ex; | ||
| 114 | int loc; | ||
| 115 | { | 98 | { |
| 116 | return(X509v3_add_ext(&(x->crl->extensions),ex,loc) != NULL); | 99 | return(X509v3_add_ext(&(x->crl->extensions),ex,loc) != NULL); |
| 117 | } | 100 | } |
| 118 | 101 | ||
| 119 | int X509_get_ext_count(x) | 102 | int X509_get_ext_count(X509 *x) |
| 120 | X509 *x; | ||
| 121 | { | 103 | { |
| 122 | return(X509v3_get_ext_count(x->cert_info->extensions)); | 104 | return(X509v3_get_ext_count(x->cert_info->extensions)); |
| 123 | } | 105 | } |
| 124 | 106 | ||
| 125 | int X509_get_ext_by_NID(x,nid,lastpos) | 107 | int X509_get_ext_by_NID(X509 *x, int nid, int lastpos) |
| 126 | X509 *x; | ||
| 127 | int nid; | ||
| 128 | int lastpos; | ||
| 129 | { | 108 | { |
| 130 | return(X509v3_get_ext_by_NID(x->cert_info->extensions,nid,lastpos)); | 109 | return(X509v3_get_ext_by_NID(x->cert_info->extensions,nid,lastpos)); |
| 131 | } | 110 | } |
| 132 | 111 | ||
| 133 | int X509_get_ext_by_OBJ(x,obj,lastpos) | 112 | int X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos) |
| 134 | X509 *x; | ||
| 135 | ASN1_OBJECT *obj; | ||
| 136 | int lastpos; | ||
| 137 | { | 113 | { |
| 138 | return(X509v3_get_ext_by_OBJ(x->cert_info->extensions,obj,lastpos)); | 114 | return(X509v3_get_ext_by_OBJ(x->cert_info->extensions,obj,lastpos)); |
| 139 | } | 115 | } |
| 140 | 116 | ||
| 141 | int X509_get_ext_by_critical(x,crit,lastpos) | 117 | int X509_get_ext_by_critical(X509 *x, int crit, int lastpos) |
| 142 | X509 *x; | ||
| 143 | int crit; | ||
| 144 | int lastpos; | ||
| 145 | { | 118 | { |
| 146 | return(X509v3_get_ext_by_critical(x->cert_info->extensions,crit,lastpos)); | 119 | return(X509v3_get_ext_by_critical(x->cert_info->extensions,crit,lastpos)); |
| 147 | } | 120 | } |
| 148 | 121 | ||
| 149 | X509_EXTENSION *X509_get_ext(x,loc) | 122 | X509_EXTENSION *X509_get_ext(X509 *x, int loc) |
| 150 | X509 *x; | ||
| 151 | int loc; | ||
| 152 | { | 123 | { |
| 153 | return(X509v3_get_ext(x->cert_info->extensions,loc)); | 124 | return(X509v3_get_ext(x->cert_info->extensions,loc)); |
| 154 | } | 125 | } |
| 155 | 126 | ||
| 156 | X509_EXTENSION *X509_delete_ext(x,loc) | 127 | X509_EXTENSION *X509_delete_ext(X509 *x, int loc) |
| 157 | X509 *x; | ||
| 158 | int loc; | ||
| 159 | { | 128 | { |
| 160 | return(X509v3_delete_ext(x->cert_info->extensions,loc)); | 129 | return(X509v3_delete_ext(x->cert_info->extensions,loc)); |
| 161 | } | 130 | } |
| 162 | 131 | ||
| 163 | int X509_add_ext(x,ex,loc) | 132 | int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc) |
| 164 | X509 *x; | ||
| 165 | X509_EXTENSION *ex; | ||
| 166 | int loc; | ||
| 167 | { | 133 | { |
| 168 | return(X509v3_add_ext(&(x->cert_info->extensions),ex,loc) != NULL); | 134 | return(X509v3_add_ext(&(x->cert_info->extensions),ex,loc) != NULL); |
| 169 | } | 135 | } |
| 170 | 136 | ||
| 171 | int X509_REVOKED_get_ext_count(x) | 137 | int X509_REVOKED_get_ext_count(X509_REVOKED *x) |
| 172 | X509_REVOKED *x; | ||
| 173 | { | 138 | { |
| 174 | return(X509v3_get_ext_count(x->extensions)); | 139 | return(X509v3_get_ext_count(x->extensions)); |
| 175 | } | 140 | } |
| 176 | 141 | ||
| 177 | int X509_REVOKED_get_ext_by_NID(x,nid,lastpos) | 142 | int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos) |
| 178 | X509_REVOKED *x; | ||
| 179 | int nid; | ||
| 180 | int lastpos; | ||
| 181 | { | 143 | { |
| 182 | return(X509v3_get_ext_by_NID(x->extensions,nid,lastpos)); | 144 | return(X509v3_get_ext_by_NID(x->extensions,nid,lastpos)); |
| 183 | } | 145 | } |
| 184 | 146 | ||
| 185 | int X509_REVOKED_get_ext_by_OBJ(x,obj,lastpos) | 147 | int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x, ASN1_OBJECT *obj, |
| 186 | X509_REVOKED *x; | 148 | int lastpos) |
| 187 | ASN1_OBJECT *obj; | ||
| 188 | int lastpos; | ||
| 189 | { | 149 | { |
| 190 | return(X509v3_get_ext_by_OBJ(x->extensions,obj,lastpos)); | 150 | return(X509v3_get_ext_by_OBJ(x->extensions,obj,lastpos)); |
| 191 | } | 151 | } |
| 192 | 152 | ||
| 193 | int X509_REVOKED_get_ext_by_critical(x,crit,lastpos) | 153 | int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos) |
| 194 | X509_REVOKED *x; | ||
| 195 | int crit; | ||
| 196 | int lastpos; | ||
| 197 | { | 154 | { |
| 198 | return(X509v3_get_ext_by_critical(x->extensions,crit,lastpos)); | 155 | return(X509v3_get_ext_by_critical(x->extensions,crit,lastpos)); |
| 199 | } | 156 | } |
| 200 | 157 | ||
| 201 | X509_EXTENSION *X509_REVOKED_get_ext(x,loc) | 158 | X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc) |
| 202 | X509_REVOKED *x; | ||
| 203 | int loc; | ||
| 204 | { | 159 | { |
| 205 | return(X509v3_get_ext(x->extensions,loc)); | 160 | return(X509v3_get_ext(x->extensions,loc)); |
| 206 | } | 161 | } |
| 207 | 162 | ||
| 208 | X509_EXTENSION *X509_REVOKED_delete_ext(x,loc) | 163 | X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc) |
| 209 | X509_REVOKED *x; | ||
| 210 | int loc; | ||
| 211 | { | 164 | { |
| 212 | return(X509v3_delete_ext(x->extensions,loc)); | 165 | return(X509v3_delete_ext(x->extensions,loc)); |
| 213 | } | 166 | } |
| 214 | 167 | ||
| 215 | int X509_REVOKED_add_ext(x,ex,loc) | 168 | int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc) |
| 216 | X509_REVOKED *x; | ||
| 217 | X509_EXTENSION *ex; | ||
| 218 | int loc; | ||
| 219 | { | 169 | { |
| 220 | return(X509v3_add_ext(&(x->extensions),ex,loc) != NULL); | 170 | return(X509v3_add_ext(&(x->extensions),ex,loc) != NULL); |
| 221 | } | 171 | } |
| 222 | 172 | ||
| 173 | IMPLEMENT_STACK_OF(X509_EXTENSION) | ||
| 174 | IMPLEMENT_ASN1_SET_OF(X509_EXTENSION) | ||
