summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_trs.c
diff options
context:
space:
mode:
authorbeck <>2000-12-15 02:58:47 +0000
committerbeck <>2000-12-15 02:58:47 +0000
commit9200bb13d15da4b2a23e6bc92c20e95b74aa2113 (patch)
tree5c52d628ec1e34be76e7ef2a4235d248b7c44d24 /src/lib/libcrypto/x509/x509_trs.c
parente131d25072e3d4197ba4b9bcc0d1b27d34d6488d (diff)
downloadopenbsd-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.c16
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
64static int tr_cmp(X509_TRUST **a, X509_TRUST **b); 64static int tr_cmp(const X509_TRUST * const *a,
65 const X509_TRUST * const *b);
65static void trtable_free(X509_TRUST *p); 66static void trtable_free(X509_TRUST *p);
66 67
67static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags); 68static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags);
@@ -88,7 +89,8 @@ IMPLEMENT_STACK_OF(X509_TRUST)
88 89
89static STACK_OF(X509_TRUST) *trtable = NULL; 90static STACK_OF(X509_TRUST) *trtable = NULL;
90 91
91static int tr_cmp(X509_TRUST **a, X509_TRUST **b) 92static 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