diff options
author | beck <> | 2000-12-15 02:58:47 +0000 |
---|---|---|
committer | beck <> | 2000-12-15 02:58:47 +0000 |
commit | 9200bb13d15da4b2a23e6bc92c20e95b74aa2113 (patch) | |
tree | 5c52d628ec1e34be76e7ef2a4235d248b7c44d24 /src/lib/libcrypto/x509/x509_trs.c | |
parent | e131d25072e3d4197ba4b9bcc0d1b27d34d6488d (diff) | |
download | openbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.tar.gz openbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.tar.bz2 openbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.zip |
openssl-engine-0.9.6 merge
Diffstat (limited to 'src/lib/libcrypto/x509/x509_trs.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_trs.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/lib/libcrypto/x509/x509_trs.c b/src/lib/libcrypto/x509/x509_trs.c index c779aaf94d..a7b1543461 100644 --- a/src/lib/libcrypto/x509/x509_trs.c +++ b/src/lib/libcrypto/x509/x509_trs.c | |||
@@ -61,7 +61,8 @@ | |||
61 | #include <openssl/x509v3.h> | 61 | #include <openssl/x509v3.h> |
62 | 62 | ||
63 | 63 | ||
64 | static int tr_cmp(X509_TRUST **a, X509_TRUST **b); | 64 | static int tr_cmp(const X509_TRUST * const *a, |
65 | const X509_TRUST * const *b); | ||
65 | static void trtable_free(X509_TRUST *p); | 66 | static void trtable_free(X509_TRUST *p); |
66 | 67 | ||
67 | static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags); | 68 | static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags); |
@@ -88,7 +89,8 @@ IMPLEMENT_STACK_OF(X509_TRUST) | |||
88 | 89 | ||
89 | static STACK_OF(X509_TRUST) *trtable = NULL; | 90 | static STACK_OF(X509_TRUST) *trtable = NULL; |
90 | 91 | ||
91 | static int tr_cmp(X509_TRUST **a, X509_TRUST **b) | 92 | static int tr_cmp(const X509_TRUST * const *a, |
93 | const X509_TRUST * const *b) | ||
92 | { | 94 | { |
93 | return (*a)->trust - (*b)->trust; | 95 | return (*a)->trust - (*b)->trust; |
94 | } | 96 | } |
@@ -152,15 +154,15 @@ int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), | |||
152 | idx = X509_TRUST_get_by_id(id); | 154 | idx = X509_TRUST_get_by_id(id); |
153 | /* Need a new entry */ | 155 | /* Need a new entry */ |
154 | if(idx == -1) { | 156 | if(idx == -1) { |
155 | if(!(trtmp = Malloc(sizeof(X509_TRUST)))) { | 157 | if(!(trtmp = OPENSSL_malloc(sizeof(X509_TRUST)))) { |
156 | X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE); | 158 | X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE); |
157 | return 0; | 159 | return 0; |
158 | } | 160 | } |
159 | trtmp->flags = X509_TRUST_DYNAMIC; | 161 | trtmp->flags = X509_TRUST_DYNAMIC; |
160 | } else trtmp = X509_TRUST_get0(idx); | 162 | } else trtmp = X509_TRUST_get0(idx); |
161 | 163 | ||
162 | /* Free existing name if dynamic */ | 164 | /* OPENSSL_free existing name if dynamic */ |
163 | if(trtmp->flags & X509_TRUST_DYNAMIC_NAME) Free(trtmp->name); | 165 | if(trtmp->flags & X509_TRUST_DYNAMIC_NAME) OPENSSL_free(trtmp->name); |
164 | /* dup supplied name */ | 166 | /* dup supplied name */ |
165 | if(!(trtmp->name = BUF_strdup(name))) { | 167 | if(!(trtmp->name = BUF_strdup(name))) { |
166 | X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE); | 168 | X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE); |
@@ -196,8 +198,8 @@ static void trtable_free(X509_TRUST *p) | |||
196 | if (p->flags & X509_TRUST_DYNAMIC) | 198 | if (p->flags & X509_TRUST_DYNAMIC) |
197 | { | 199 | { |
198 | if (p->flags & X509_TRUST_DYNAMIC_NAME) | 200 | if (p->flags & X509_TRUST_DYNAMIC_NAME) |
199 | Free(p->name); | 201 | OPENSSL_free(p->name); |
200 | Free(p); | 202 | OPENSSL_free(p); |
201 | } | 203 | } |
202 | } | 204 | } |
203 | 205 | ||