diff options
| author | markus <> | 2002-07-30 11:08:06 +0000 |
|---|---|---|
| committer | markus <> | 2002-07-30 11:08:06 +0000 |
| commit | c54a116b266c232d9e0ffad482eb5f8b98130ac4 (patch) | |
| tree | 829382cb1d2140dc2ace3ac2b408324cabadb2f9 /src/lib/libc | |
| parent | cc19216028038523578d8437fd5fe68bada0def0 (diff) | |
| download | openbsd-c54a116b266c232d9e0ffad482eb5f8b98130ac4.tar.gz openbsd-c54a116b266c232d9e0ffad482eb5f8b98130ac4.tar.bz2 openbsd-c54a116b266c232d9e0ffad482eb5f8b98130ac4.zip | |
apply patches from OpenSSL Security Advisory [30 July 2002],
http://marc.theaimsgroup.com/?l=openssl-dev&m=102802395104110&w=2
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/asn1/asn1_lib.c | 10 | ||||
| -rw-r--r-- | src/lib/libcrypto/conf/conf_def.c | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/cryptlib.h | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/objects/obj_dat.c | 2 |
4 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c index 830ff2af3c..fd8e77044e 100644 --- a/src/lib/libcrypto/asn1/asn1_lib.c +++ b/src/lib/libcrypto/asn1/asn1_lib.c | |||
| @@ -123,15 +123,13 @@ int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, int *pclass, | |||
| 123 | (int)(omax+ *pp)); | 123 | (int)(omax+ *pp)); |
| 124 | 124 | ||
| 125 | #endif | 125 | #endif |
| 126 | #if 0 | 126 | if (*plength > (omax - (*pp - p))) |
| 127 | if ((p+ *plength) > (omax+ *pp)) | ||
| 128 | { | 127 | { |
| 129 | ASN1err(ASN1_F_ASN1_GET_OBJECT,ASN1_R_TOO_LONG); | 128 | ASN1err(ASN1_F_ASN1_GET_OBJECT,ASN1_R_TOO_LONG); |
| 130 | /* Set this so that even if things are not long enough | 129 | /* Set this so that even if things are not long enough |
| 131 | * the values are set correctly */ | 130 | * the values are set correctly */ |
| 132 | ret|=0x80; | 131 | ret|=0x80; |
| 133 | } | 132 | } |
| 134 | #endif | ||
| 135 | *pp=p; | 133 | *pp=p; |
| 136 | return(ret|inf); | 134 | return(ret|inf); |
| 137 | err: | 135 | err: |
| @@ -158,6 +156,8 @@ static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max) | |||
| 158 | i= *p&0x7f; | 156 | i= *p&0x7f; |
| 159 | if (*(p++) & 0x80) | 157 | if (*(p++) & 0x80) |
| 160 | { | 158 | { |
| 159 | if (i > sizeof(long)) | ||
| 160 | return 0; | ||
| 161 | if (max-- == 0) return(0); | 161 | if (max-- == 0) return(0); |
| 162 | while (i-- > 0) | 162 | while (i-- > 0) |
| 163 | { | 163 | { |
| @@ -169,6 +169,8 @@ static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max) | |||
| 169 | else | 169 | else |
| 170 | ret=i; | 170 | ret=i; |
| 171 | } | 171 | } |
| 172 | if (ret < 0) | ||
| 173 | return 0; | ||
| 172 | *pp=p; | 174 | *pp=p; |
| 173 | *rl=ret; | 175 | *rl=ret; |
| 174 | return(1); | 176 | return(1); |
| @@ -406,7 +408,7 @@ int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b) | |||
| 406 | 408 | ||
| 407 | void asn1_add_error(unsigned char *address, int offset) | 409 | void asn1_add_error(unsigned char *address, int offset) |
| 408 | { | 410 | { |
| 409 | char buf1[16],buf2[16]; | 411 | char buf1[DECIMAL_SIZE(address)+1],buf2[DECIMAL_SIZE(offset)+1]; |
| 410 | 412 | ||
| 411 | sprintf(buf1,"%lu",(unsigned long)address); | 413 | sprintf(buf1,"%lu",(unsigned long)address); |
| 412 | sprintf(buf2,"%d",offset); | 414 | sprintf(buf2,"%d",offset); |
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c index 31f2766246..5e194de60e 100644 --- a/src/lib/libcrypto/conf/conf_def.c +++ b/src/lib/libcrypto/conf/conf_def.c | |||
| @@ -67,6 +67,7 @@ | |||
| 67 | #include "conf_def.h" | 67 | #include "conf_def.h" |
| 68 | #include <openssl/buffer.h> | 68 | #include <openssl/buffer.h> |
| 69 | #include <openssl/err.h> | 69 | #include <openssl/err.h> |
| 70 | #include "cryptlib.h" | ||
| 70 | 71 | ||
| 71 | static char *eat_ws(CONF *conf, char *p); | 72 | static char *eat_ws(CONF *conf, char *p); |
| 72 | static char *eat_alpha_numeric(CONF *conf, char *p); | 73 | static char *eat_alpha_numeric(CONF *conf, char *p); |
| @@ -208,12 +209,12 @@ static int def_load(CONF *conf, const char *name, long *line) | |||
| 208 | static int def_load_bio(CONF *conf, BIO *in, long *line) | 209 | static int def_load_bio(CONF *conf, BIO *in, long *line) |
| 209 | { | 210 | { |
| 210 | #define BUFSIZE 512 | 211 | #define BUFSIZE 512 |
| 211 | char btmp[16]; | ||
| 212 | int bufnum=0,i,ii; | 212 | int bufnum=0,i,ii; |
| 213 | BUF_MEM *buff=NULL; | 213 | BUF_MEM *buff=NULL; |
| 214 | char *s,*p,*end; | 214 | char *s,*p,*end; |
| 215 | int again,n; | 215 | int again,n; |
| 216 | long eline=0; | 216 | long eline=0; |
| 217 | char btmp[DECIMAL_SIZE(eline)+1]; | ||
| 217 | CONF_VALUE *v=NULL,*tv; | 218 | CONF_VALUE *v=NULL,*tv; |
| 218 | CONF_VALUE *sv=NULL; | 219 | CONF_VALUE *sv=NULL; |
| 219 | char *section=NULL,*buf; | 220 | char *section=NULL,*buf; |
diff --git a/src/lib/libcrypto/cryptlib.h b/src/lib/libcrypto/cryptlib.h index a0489e57fc..37ce7721fb 100644 --- a/src/lib/libcrypto/cryptlib.h +++ b/src/lib/libcrypto/cryptlib.h | |||
| @@ -89,6 +89,9 @@ extern "C" { | |||
| 89 | #define X509_CERT_DIR_EVP "SSL_CERT_DIR" | 89 | #define X509_CERT_DIR_EVP "SSL_CERT_DIR" |
| 90 | #define X509_CERT_FILE_EVP "SSL_CERT_FILE" | 90 | #define X509_CERT_FILE_EVP "SSL_CERT_FILE" |
| 91 | 91 | ||
| 92 | /* size of string represenations */ | ||
| 93 | #define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1) | ||
| 94 | |||
| 92 | #ifdef __cplusplus | 95 | #ifdef __cplusplus |
| 93 | } | 96 | } |
| 94 | #endif | 97 | #endif |
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c index 3ff64bb8d1..02c3719f04 100644 --- a/src/lib/libcrypto/objects/obj_dat.c +++ b/src/lib/libcrypto/objects/obj_dat.c | |||
| @@ -436,7 +436,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name) | |||
| 436 | unsigned long l; | 436 | unsigned long l; |
| 437 | unsigned char *p; | 437 | unsigned char *p; |
| 438 | const char *s; | 438 | const char *s; |
| 439 | char tbuf[32]; | 439 | char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2]; |
| 440 | 440 | ||
| 441 | if (buf_len <= 0) return(0); | 441 | if (buf_len <= 0) return(0); |
| 442 | 442 | ||
