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/txt_db | |
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/txt_db')
-rw-r--r-- | src/lib/libcrypto/txt_db/Makefile.ssl | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/txt_db/txt_db.c | 28 | ||||
-rw-r--r-- | src/lib/libcrypto/txt_db/txt_db.h | 11 |
3 files changed, 23 insertions, 20 deletions
diff --git a/src/lib/libcrypto/txt_db/Makefile.ssl b/src/lib/libcrypto/txt_db/Makefile.ssl index a631dce6f2..cb54d53323 100644 --- a/src/lib/libcrypto/txt_db/Makefile.ssl +++ b/src/lib/libcrypto/txt_db/Makefile.ssl | |||
@@ -83,5 +83,5 @@ txt_db.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | |||
83 | txt_db.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 83 | txt_db.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
84 | txt_db.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 84 | txt_db.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
85 | txt_db.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 85 | txt_db.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h |
86 | txt_db.o: ../../include/openssl/stack.h ../../include/openssl/txt_db.h | 86 | txt_db.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
87 | txt_db.o: ../cryptlib.h | 87 | txt_db.o: ../../include/openssl/txt_db.h ../cryptlib.h |
diff --git a/src/lib/libcrypto/txt_db/txt_db.c b/src/lib/libcrypto/txt_db/txt_db.c index 33acc81f3f..3b04fe280c 100644 --- a/src/lib/libcrypto/txt_db/txt_db.c +++ b/src/lib/libcrypto/txt_db/txt_db.c | |||
@@ -83,16 +83,16 @@ TXT_DB *TXT_DB_read(BIO *in, int num) | |||
83 | if ((buf=BUF_MEM_new()) == NULL) goto err; | 83 | if ((buf=BUF_MEM_new()) == NULL) goto err; |
84 | if (!BUF_MEM_grow(buf,size)) goto err; | 84 | if (!BUF_MEM_grow(buf,size)) goto err; |
85 | 85 | ||
86 | if ((ret=(TXT_DB *)Malloc(sizeof(TXT_DB))) == NULL) | 86 | if ((ret=(TXT_DB *)OPENSSL_malloc(sizeof(TXT_DB))) == NULL) |
87 | goto err; | 87 | goto err; |
88 | ret->num_fields=num; | 88 | ret->num_fields=num; |
89 | ret->index=NULL; | 89 | ret->index=NULL; |
90 | ret->qual=NULL; | 90 | ret->qual=NULL; |
91 | if ((ret->data=sk_new_null()) == NULL) | 91 | if ((ret->data=sk_new_null()) == NULL) |
92 | goto err; | 92 | goto err; |
93 | if ((ret->index=(LHASH **)Malloc(sizeof(LHASH *)*num)) == NULL) | 93 | if ((ret->index=(LHASH **)OPENSSL_malloc(sizeof(LHASH *)*num)) == NULL) |
94 | goto err; | 94 | goto err; |
95 | if ((ret->qual=(int (**)())Malloc(sizeof(int (**)())*num)) == NULL) | 95 | if ((ret->qual=(int (**)())OPENSSL_malloc(sizeof(int (**)())*num)) == NULL) |
96 | goto err; | 96 | goto err; |
97 | for (i=0; i<num; i++) | 97 | for (i=0; i<num; i++) |
98 | { | 98 | { |
@@ -122,7 +122,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num) | |||
122 | else | 122 | else |
123 | { | 123 | { |
124 | buf->data[offset-1]='\0'; /* blat the '\n' */ | 124 | buf->data[offset-1]='\0'; /* blat the '\n' */ |
125 | p=(char *)Malloc(add+offset); | 125 | p=(char *)OPENSSL_malloc(add+offset); |
126 | offset=0; | 126 | offset=0; |
127 | } | 127 | } |
128 | pp=(char **)p; | 128 | pp=(char **)p; |
@@ -177,12 +177,12 @@ err: | |||
177 | if (er) | 177 | if (er) |
178 | { | 178 | { |
179 | #if !defined(NO_STDIO) && !defined(WIN16) | 179 | #if !defined(NO_STDIO) && !defined(WIN16) |
180 | if (er == 1) fprintf(stderr,"Malloc failure\n"); | 180 | if (er == 1) fprintf(stderr,"OPENSSL_malloc failure\n"); |
181 | #endif | 181 | #endif |
182 | if (ret->data != NULL) sk_free(ret->data); | 182 | if (ret->data != NULL) sk_free(ret->data); |
183 | if (ret->index != NULL) Free(ret->index); | 183 | if (ret->index != NULL) OPENSSL_free(ret->index); |
184 | if (ret->qual != NULL) Free(ret->qual); | 184 | if (ret->qual != NULL) OPENSSL_free(ret->qual); |
185 | if (ret != NULL) Free(ret); | 185 | if (ret != NULL) OPENSSL_free(ret); |
186 | return(NULL); | 186 | return(NULL); |
187 | } | 187 | } |
188 | else | 188 | else |
@@ -349,10 +349,10 @@ void TXT_DB_free(TXT_DB *db) | |||
349 | { | 349 | { |
350 | for (i=db->num_fields-1; i>=0; i--) | 350 | for (i=db->num_fields-1; i>=0; i--) |
351 | if (db->index[i] != NULL) lh_free(db->index[i]); | 351 | if (db->index[i] != NULL) lh_free(db->index[i]); |
352 | Free(db->index); | 352 | OPENSSL_free(db->index); |
353 | } | 353 | } |
354 | if (db->qual != NULL) | 354 | if (db->qual != NULL) |
355 | Free(db->qual); | 355 | OPENSSL_free(db->qual); |
356 | if (db->data != NULL) | 356 | if (db->data != NULL) |
357 | { | 357 | { |
358 | for (i=sk_num(db->data)-1; i>=0; i--) | 358 | for (i=sk_num(db->data)-1; i>=0; i--) |
@@ -364,7 +364,7 @@ void TXT_DB_free(TXT_DB *db) | |||
364 | if (max == NULL) /* new row */ | 364 | if (max == NULL) /* new row */ |
365 | { | 365 | { |
366 | for (n=0; n<db->num_fields; n++) | 366 | for (n=0; n<db->num_fields; n++) |
367 | if (p[n] != NULL) Free(p[n]); | 367 | if (p[n] != NULL) OPENSSL_free(p[n]); |
368 | } | 368 | } |
369 | else | 369 | else |
370 | { | 370 | { |
@@ -372,12 +372,12 @@ void TXT_DB_free(TXT_DB *db) | |||
372 | { | 372 | { |
373 | if (((p[n] < (char *)p) || (p[n] > max)) | 373 | if (((p[n] < (char *)p) || (p[n] > max)) |
374 | && (p[n] != NULL)) | 374 | && (p[n] != NULL)) |
375 | Free(p[n]); | 375 | OPENSSL_free(p[n]); |
376 | } | 376 | } |
377 | } | 377 | } |
378 | Free(sk_value(db->data,i)); | 378 | OPENSSL_free(sk_value(db->data,i)); |
379 | } | 379 | } |
380 | sk_free(db->data); | 380 | sk_free(db->data); |
381 | } | 381 | } |
382 | Free(db); | 382 | OPENSSL_free(db); |
383 | } | 383 | } |
diff --git a/src/lib/libcrypto/txt_db/txt_db.h b/src/lib/libcrypto/txt_db/txt_db.h index 58b9de1353..342533d40d 100644 --- a/src/lib/libcrypto/txt_db/txt_db.h +++ b/src/lib/libcrypto/txt_db/txt_db.h | |||
@@ -59,10 +59,9 @@ | |||
59 | #ifndef HEADER_TXT_DB_H | 59 | #ifndef HEADER_TXT_DB_H |
60 | #define HEADER_TXT_DB_H | 60 | #define HEADER_TXT_DB_H |
61 | 61 | ||
62 | #ifdef __cplusplus | 62 | #ifndef NO_BIO |
63 | extern "C" { | 63 | #include <openssl/bio.h> |
64 | #endif | 64 | #endif |
65 | |||
66 | #include <openssl/stack.h> | 65 | #include <openssl/stack.h> |
67 | #include <openssl/lhash.h> | 66 | #include <openssl/lhash.h> |
68 | 67 | ||
@@ -73,6 +72,10 @@ extern "C" { | |||
73 | #define DB_ERROR_NO_INDEX 4 | 72 | #define DB_ERROR_NO_INDEX 4 |
74 | #define DB_ERROR_INSERT_INDEX_CLASH 5 | 73 | #define DB_ERROR_INSERT_INDEX_CLASH 5 |
75 | 74 | ||
75 | #ifdef __cplusplus | ||
76 | extern "C" { | ||
77 | #endif | ||
78 | |||
76 | typedef struct txt_db_st | 79 | typedef struct txt_db_st |
77 | { | 80 | { |
78 | int num_fields; | 81 | int num_fields; |
@@ -85,7 +88,7 @@ typedef struct txt_db_st | |||
85 | char **arg_row; | 88 | char **arg_row; |
86 | } TXT_DB; | 89 | } TXT_DB; |
87 | 90 | ||
88 | #ifdef HEADER_BIO_H | 91 | #ifndef NO_BIO |
89 | TXT_DB *TXT_DB_read(BIO *in, int num); | 92 | TXT_DB *TXT_DB_read(BIO *in, int num); |
90 | long TXT_DB_write(BIO *out, TXT_DB *db); | 93 | long TXT_DB_write(BIO *out, TXT_DB *db); |
91 | #else | 94 | #else |