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/txt_db | |
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/txt_db')
-rw-r--r-- | src/lib/libcrypto/txt_db/Makefile.ssl | 36 | ||||
-rw-r--r-- | src/lib/libcrypto/txt_db/txt_db.c | 39 | ||||
-rw-r--r-- | src/lib/libcrypto/txt_db/txt_db.h | 16 |
3 files changed, 37 insertions, 54 deletions
diff --git a/src/lib/libcrypto/txt_db/Makefile.ssl b/src/lib/libcrypto/txt_db/Makefile.ssl index 76e511534f..552ea5580f 100644 --- a/src/lib/libcrypto/txt_db/Makefile.ssl +++ b/src/lib/libcrypto/txt_db/Makefile.ssl | |||
@@ -7,9 +7,11 @@ TOP= ../.. | |||
7 | CC= cc | 7 | CC= cc |
8 | INCLUDES= | 8 | INCLUDES= |
9 | CFLAG=-g | 9 | CFLAG=-g |
10 | INSTALL_PREFIX= | ||
11 | OPENSSLDIR= /usr/local/ssl | ||
10 | INSTALLTOP=/usr/local/ssl | 12 | INSTALLTOP=/usr/local/ssl |
11 | MAKE= make -f Makefile.ssl | 13 | MAKE= make -f Makefile.ssl |
12 | MAKEDEPEND= makedepend -f Makefile.ssl | 14 | MAKEDEPEND= $(TOP)/util/domd $(TOP) |
13 | MAKEFILE= Makefile.ssl | 15 | MAKEFILE= Makefile.ssl |
14 | AR= ar r | 16 | AR= ar r |
15 | 17 | ||
@@ -37,24 +39,23 @@ all: lib | |||
37 | 39 | ||
38 | lib: $(LIBOBJ) | 40 | lib: $(LIBOBJ) |
39 | $(AR) $(LIB) $(LIBOBJ) | 41 | $(AR) $(LIB) $(LIBOBJ) |
40 | sh $(TOP)/util/ranlib.sh $(LIB) | 42 | $(RANLIB) $(LIB) |
41 | @touch lib | 43 | @touch lib |
42 | 44 | ||
43 | files: | 45 | files: |
44 | perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | 46 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO |
45 | 47 | ||
46 | links: | 48 | links: |
47 | /bin/rm -f Makefile | 49 | @$(TOP)/util/point.sh Makefile.ssl Makefile |
48 | $(TOP)/util/point.sh Makefile.ssl Makefile ; | 50 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) |
49 | $(TOP)/util/mklink.sh ../../include $(EXHEADER) | 51 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) |
50 | $(TOP)/util/mklink.sh ../../test $(TEST) | 52 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) |
51 | $(TOP)/util/mklink.sh ../../apps $(APPS) | ||
52 | 53 | ||
53 | install: | 54 | install: |
54 | @for i in $(EXHEADER) ; \ | 55 | @for i in $(EXHEADER) ; \ |
55 | do \ | 56 | do \ |
56 | (cp $$i $(INSTALLTOP)/include/$$i; \ | 57 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ |
57 | chmod 644 $(INSTALLTOP)/include/$$i ); \ | 58 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ |
58 | done; | 59 | done; |
59 | 60 | ||
60 | tags: | 61 | tags: |
@@ -66,15 +67,20 @@ lint: | |||
66 | lint -DLINT $(INCLUDES) $(SRC)>fluff | 67 | lint -DLINT $(INCLUDES) $(SRC)>fluff |
67 | 68 | ||
68 | depend: | 69 | depend: |
69 | $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) | 70 | $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC) |
70 | 71 | ||
71 | dclean: | 72 | dclean: |
72 | perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | 73 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new |
73 | mv -f Makefile.new $(MAKEFILE) | 74 | mv -f Makefile.new $(MAKEFILE) |
74 | 75 | ||
75 | clean: | 76 | clean: |
76 | /bin/rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | 77 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff |
77 | |||
78 | errors: | ||
79 | 78 | ||
80 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 79 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
80 | |||
81 | txt_db.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
82 | 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 | ||
84 | txt_db.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
85 | txt_db.o: ../../include/openssl/opensslv.h ../../include/openssl/stack.h | ||
86 | 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 e34ce4efa9..9a9fa5ce55 100644 --- a/src/lib/libcrypto/txt_db/txt_db.c +++ b/src/lib/libcrypto/txt_db/txt_db.c | |||
@@ -60,17 +60,15 @@ | |||
60 | #include <stdlib.h> | 60 | #include <stdlib.h> |
61 | #include <string.h> | 61 | #include <string.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "buffer.h" | 63 | #include <openssl/buffer.h> |
64 | #include "txt_db.h" | 64 | #include <openssl/txt_db.h> |
65 | 65 | ||
66 | #undef BUFSIZE | 66 | #undef BUFSIZE |
67 | #define BUFSIZE 512 | 67 | #define BUFSIZE 512 |
68 | 68 | ||
69 | char *TXT_DB_version="TXT_DB part of SSLeay 0.9.0b 29-Jun-1998"; | 69 | const char *TXT_DB_version="TXT_DB" OPENSSL_VERSION_PTEXT; |
70 | 70 | ||
71 | TXT_DB *TXT_DB_read(in,num) | 71 | TXT_DB *TXT_DB_read(BIO *in, int num) |
72 | BIO *in; | ||
73 | int num; | ||
74 | { | 72 | { |
75 | TXT_DB *ret=NULL; | 73 | TXT_DB *ret=NULL; |
76 | int er=1; | 74 | int er=1; |
@@ -158,7 +156,7 @@ int num; | |||
158 | if ((n != num) || (*f != '\0')) | 156 | if ((n != num) || (*f != '\0')) |
159 | { | 157 | { |
160 | #if !defined(NO_STDIO) && !defined(WIN16) /* temporaty fix :-( */ | 158 | #if !defined(NO_STDIO) && !defined(WIN16) /* temporaty fix :-( */ |
161 | fprintf(stderr,"wrong number of fields on line %ld\n",ln); | 159 | fprintf(stderr,"wrong number of fields on line %ld (looking for field %d, got %d, '%s' left)\n",ln,num,n,f); |
162 | #endif | 160 | #endif |
163 | er=2; | 161 | er=2; |
164 | goto err; | 162 | goto err; |
@@ -191,10 +189,7 @@ err: | |||
191 | return(ret); | 189 | return(ret); |
192 | } | 190 | } |
193 | 191 | ||
194 | char **TXT_DB_get_by_index(db,idx,value) | 192 | char **TXT_DB_get_by_index(TXT_DB *db, int idx, char **value) |
195 | TXT_DB *db; | ||
196 | int idx; | ||
197 | char **value; | ||
198 | { | 193 | { |
199 | char **ret; | 194 | char **ret; |
200 | LHASH *lh; | 195 | LHASH *lh; |
@@ -215,12 +210,8 @@ char **value; | |||
215 | return(ret); | 210 | return(ret); |
216 | } | 211 | } |
217 | 212 | ||
218 | int TXT_DB_create_index(db,field,qual,hash,cmp) | 213 | int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(), |
219 | TXT_DB *db; | 214 | unsigned long (*hash)(), int (*cmp)()) |
220 | int field; | ||
221 | int (*qual)(); | ||
222 | unsigned long (*hash)(); | ||
223 | int (*cmp)(); | ||
224 | { | 215 | { |
225 | LHASH *idx; | 216 | LHASH *idx; |
226 | char *r; | 217 | char *r; |
@@ -256,9 +247,7 @@ int (*cmp)(); | |||
256 | return(1); | 247 | return(1); |
257 | } | 248 | } |
258 | 249 | ||
259 | long TXT_DB_write(out,db) | 250 | long TXT_DB_write(BIO *out, TXT_DB *db) |
260 | BIO *out; | ||
261 | TXT_DB *db; | ||
262 | { | 251 | { |
263 | long i,j,n,nn,l,tot=0; | 252 | long i,j,n,nn,l,tot=0; |
264 | char *p,**pp,*f; | 253 | char *p,**pp,*f; |
@@ -306,9 +295,7 @@ err: | |||
306 | return(ret); | 295 | return(ret); |
307 | } | 296 | } |
308 | 297 | ||
309 | int TXT_DB_insert(db,row) | 298 | int TXT_DB_insert(TXT_DB *db, char **row) |
310 | TXT_DB *db; | ||
311 | char **row; | ||
312 | { | 299 | { |
313 | int i; | 300 | int i; |
314 | char **r; | 301 | char **r; |
@@ -350,12 +337,14 @@ err: | |||
350 | return(0); | 337 | return(0); |
351 | } | 338 | } |
352 | 339 | ||
353 | void TXT_DB_free(db) | 340 | void TXT_DB_free(TXT_DB *db) |
354 | TXT_DB *db; | ||
355 | { | 341 | { |
356 | int i,n; | 342 | int i,n; |
357 | char **p,*max; | 343 | char **p,*max; |
358 | 344 | ||
345 | if(db == NULL) | ||
346 | return; | ||
347 | |||
359 | if (db->index != NULL) | 348 | if (db->index != NULL) |
360 | { | 349 | { |
361 | for (i=db->num_fields-1; i>=0; i--) | 350 | for (i=db->num_fields-1; i>=0; i--) |
diff --git a/src/lib/libcrypto/txt_db/txt_db.h b/src/lib/libcrypto/txt_db/txt_db.h index aca6dae393..58b9de1353 100644 --- a/src/lib/libcrypto/txt_db/txt_db.h +++ b/src/lib/libcrypto/txt_db/txt_db.h | |||
@@ -63,8 +63,8 @@ | |||
63 | extern "C" { | 63 | extern "C" { |
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | #include "stack.h" | 66 | #include <openssl/stack.h> |
67 | #include "lhash.h" | 67 | #include <openssl/lhash.h> |
68 | 68 | ||
69 | #define DB_ERROR_OK 0 | 69 | #define DB_ERROR_OK 0 |
70 | #define DB_ERROR_MALLOC 1 | 70 | #define DB_ERROR_MALLOC 1 |
@@ -85,7 +85,6 @@ typedef struct txt_db_st | |||
85 | char **arg_row; | 85 | char **arg_row; |
86 | } TXT_DB; | 86 | } TXT_DB; |
87 | 87 | ||
88 | #ifndef NOPROTO | ||
89 | #ifdef HEADER_BIO_H | 88 | #ifdef HEADER_BIO_H |
90 | TXT_DB *TXT_DB_read(BIO *in, int num); | 89 | TXT_DB *TXT_DB_read(BIO *in, int num); |
91 | long TXT_DB_write(BIO *out, TXT_DB *db); | 90 | long TXT_DB_write(BIO *out, TXT_DB *db); |
@@ -99,17 +98,6 @@ void TXT_DB_free(TXT_DB *db); | |||
99 | char **TXT_DB_get_by_index(TXT_DB *db, int idx, char **value); | 98 | char **TXT_DB_get_by_index(TXT_DB *db, int idx, char **value); |
100 | int TXT_DB_insert(TXT_DB *db,char **value); | 99 | int TXT_DB_insert(TXT_DB *db,char **value); |
101 | 100 | ||
102 | #else | ||
103 | |||
104 | TXT_DB *TXT_DB_read(); | ||
105 | long TXT_DB_write(); | ||
106 | int TXT_DB_create_index(); | ||
107 | void TXT_DB_free(); | ||
108 | char **TXT_DB_get_by_index(); | ||
109 | int TXT_DB_insert(); | ||
110 | |||
111 | #endif | ||
112 | |||
113 | #ifdef __cplusplus | 101 | #ifdef __cplusplus |
114 | } | 102 | } |
115 | #endif | 103 | #endif |