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