diff options
| author | beck <> | 2001-06-22 00:03:44 +0000 |
|---|---|---|
| committer | beck <> | 2001-06-22 00:03:44 +0000 |
| commit | 38b6ff9e5294811c57541ad47940f8f8f41dc114 (patch) | |
| tree | 402699541cee3cf3f2943b0384dbda7de534de70 /src/lib/libcrypto/x509 | |
| parent | afae624d63e4e717c5bae8c7842a4712309f728f (diff) | |
| download | openbsd-38b6ff9e5294811c57541ad47940f8f8f41dc114.tar.gz openbsd-38b6ff9e5294811c57541ad47940f8f8f41dc114.tar.bz2 openbsd-38b6ff9e5294811c57541ad47940f8f8f41dc114.zip | |
openssl-engine-0.9.6a merge
Diffstat (limited to 'src/lib/libcrypto/x509')
| -rw-r--r-- | src/lib/libcrypto/x509/Makefile.ssl | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/by_dir.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/x509_cmp.c | 18 |
3 files changed, 9 insertions, 14 deletions
diff --git a/src/lib/libcrypto/x509/Makefile.ssl b/src/lib/libcrypto/x509/Makefile.ssl index 4619693733..79f09d4f71 100644 --- a/src/lib/libcrypto/x509/Makefile.ssl +++ b/src/lib/libcrypto/x509/Makefile.ssl | |||
| @@ -49,7 +49,8 @@ all: lib | |||
| 49 | 49 | ||
| 50 | lib: $(LIBOBJ) | 50 | lib: $(LIBOBJ) |
| 51 | $(AR) $(LIB) $(LIBOBJ) | 51 | $(AR) $(LIB) $(LIBOBJ) |
| 52 | $(RANLIB) $(LIB) | 52 | @echo You may get an error following this line. Please ignore. |
| 53 | - $(RANLIB) $(LIB) | ||
| 53 | @touch lib | 54 | @touch lib |
| 54 | 55 | ||
| 55 | files: | 56 | files: |
diff --git a/src/lib/libcrypto/x509/by_dir.c b/src/lib/libcrypto/x509/by_dir.c index cac64a6f40..448bd7e69c 100644 --- a/src/lib/libcrypto/x509/by_dir.c +++ b/src/lib/libcrypto/x509/by_dir.c | |||
| @@ -327,7 +327,7 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, | |||
| 327 | * it out again */ | 327 | * it out again */ |
| 328 | CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE); | 328 | CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE); |
| 329 | j = sk_X509_OBJECT_find(xl->store_ctx->objs,&stmp); | 329 | j = sk_X509_OBJECT_find(xl->store_ctx->objs,&stmp); |
| 330 | if(j != -1) tmp=sk_X509_OBJECT_value(xl->store_ctx->objs,i); | 330 | if(j != -1) tmp=sk_X509_OBJECT_value(xl->store_ctx->objs,j); |
| 331 | else tmp = NULL; | 331 | else tmp = NULL; |
| 332 | CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE); | 332 | CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE); |
| 333 | 333 | ||
diff --git a/src/lib/libcrypto/x509/x509_cmp.c b/src/lib/libcrypto/x509/x509_cmp.c index b147d573d2..3f9f9b3d47 100644 --- a/src/lib/libcrypto/x509/x509_cmp.c +++ b/src/lib/libcrypto/x509/x509_cmp.c | |||
| @@ -199,19 +199,13 @@ unsigned long X509_NAME_hash(X509_NAME *x) | |||
| 199 | { | 199 | { |
| 200 | unsigned long ret=0; | 200 | unsigned long ret=0; |
| 201 | unsigned char md[16]; | 201 | unsigned char md[16]; |
| 202 | unsigned char str[256],*p,*pp; | ||
| 203 | int i; | ||
| 204 | |||
| 205 | i=i2d_X509_NAME(x,NULL); | ||
| 206 | if (i > sizeof(str)) | ||
| 207 | p=OPENSSL_malloc(i); | ||
| 208 | else | ||
| 209 | p=str; | ||
| 210 | 202 | ||
| 211 | pp=p; | 203 | /* Ensure cached version is up to date */ |
| 212 | i2d_X509_NAME(x,&pp); | 204 | i2d_X509_NAME(x,NULL); |
| 213 | MD5((unsigned char *)p,i,&(md[0])); | 205 | /* Use cached encoding directly rather than copying: this should |
| 214 | if (p != str) OPENSSL_free(p); | 206 | * keep libsafe happy. |
| 207 | */ | ||
| 208 | MD5((unsigned char *)x->bytes->data,x->bytes->length,&(md[0])); | ||
| 215 | 209 | ||
| 216 | ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)| | 210 | ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)| |
| 217 | ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L) | 211 | ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L) |
