diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2014-08-07 16:51:50 +0000 |
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2014-08-07 16:51:50 +0000 |
| commit | 6846a6dfd06216c71f1c9d1da1fa957d0f9ce016 (patch) | |
| tree | b4301f78efe63b5c59d963d87744b03588432bd4 /apps | |
| parent | f2c8f580eb02fc9ff060de5b242c825113c7a065 (diff) | |
Import 0.9.8zb.vendor/openssl/0.9.8zb
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/apps.c | 4 | ||||
| -rw-r--r-- | apps/ca.c | 5 | ||||
| -rw-r--r-- | apps/crl2p7.c | 8 | ||||
| -rw-r--r-- | apps/ocsp.c | 2 | ||||
| -rw-r--r-- | apps/s_server.c | 16 | ||||
| -rw-r--r-- | apps/speed.c | 12 |
6 files changed, 40 insertions, 7 deletions
diff --git a/apps/apps.c b/apps/apps.c index ce8d9c9a7d1f..792b2540f393 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -362,6 +362,8 @@ int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[]) { arg->count=20; arg->data=(char **)OPENSSL_malloc(sizeof(char *)*arg->count); + if (arg->data == NULL) + return 0; } for (i=0; i<arg->count; i++) arg->data[i]=NULL; @@ -1429,6 +1431,8 @@ char *make_config_name() len=strlen(t)+strlen(OPENSSL_CONF)+2; p=OPENSSL_malloc(len); + if (p == NULL) + return NULL; BUF_strlcpy(p,t,len); #ifndef OPENSSL_SYS_VMS BUF_strlcat(p,"/",len); diff --git a/apps/ca.c b/apps/ca.c index 651c5a648afc..45c3183b9b29 100644 --- a/apps/ca.c +++ b/apps/ca.c @@ -1582,12 +1582,14 @@ static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, { ok=0; BIO_printf(bio_err,"Signature verification problems....\n"); + ERR_print_errors(bio_err); goto err; } if (i == 0) { ok=0; BIO_printf(bio_err,"Signature did not match the certificate request\n"); + ERR_print_errors(bio_err); goto err; } else @@ -2751,6 +2753,9 @@ char *make_revocation_str(int rev_type, char *rev_arg) revtm = X509_gmtime_adj(NULL, 0); + if (!revtm) + return NULL; + i = revtm->length + 1; if (reason) i += strlen(reason) + 1; diff --git a/apps/crl2p7.c b/apps/crl2p7.c index b2f2d121d56c..f164a3ad9448 100644 --- a/apps/crl2p7.c +++ b/apps/crl2p7.c @@ -142,7 +142,13 @@ int MAIN(int argc, char **argv) { if (--argc < 1) goto bad; if(!certflst) certflst = sk_new_null(); - sk_push(certflst,*(++argv)); + if (!certflst) + goto end; + if (!sk_push(certflst,*(++argv))) + { + sk_free(certflst); + goto end; + } } else { diff --git a/apps/ocsp.c b/apps/ocsp.c index 891f3ee8068b..773fd23e149c 100644 --- a/apps/ocsp.c +++ b/apps/ocsp.c @@ -1344,7 +1344,7 @@ OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req, } resp = query_responder(err, cbio, path, req, req_timeout); if (!resp) - BIO_printf(bio_err, "Error querying OCSP responsder\n"); + BIO_printf(bio_err, "Error querying OCSP responder\n"); end: if (ctx) SSL_CTX_free(ctx); diff --git a/apps/s_server.c b/apps/s_server.c index 1f1f317d419a..a6af637bcfb6 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -583,7 +583,7 @@ static int MS_CALLBACK ssl_servername_cb(SSL *s, int *ad, void *arg) if (servername) { - if (strcmp(servername,p->servername)) + if (strcasecmp(servername,p->servername)) return p->extension_error; if (ctx2) { @@ -1095,6 +1095,14 @@ bad: sv_usage(); goto end; } +#ifndef OPENSSL_NO_DTLS1 + if (www && socket_type == SOCK_DGRAM) + { + BIO_printf(bio_err, + "Can't use -HTTP, -www or -WWW with DTLS\n"); + goto end; + } +#endif SSL_load_error_strings(); OpenSSL_add_ssl_algorithms(); @@ -1922,8 +1930,10 @@ again: #ifdef CHARSET_EBCDIC ascii2ebcdic(buf,buf,i); #endif - write(fileno(stdout),buf, - (unsigned int)i); + if (write(fileno(stdout),buf, + (unsigned int)i) != i) + goto err; + if (SSL_pending(con)) goto again; break; case SSL_ERROR_WANT_WRITE: diff --git a/apps/speed.c b/apps/speed.c index 84ce35dbd161..ff2587ef3529 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -2767,7 +2767,11 @@ static int do_multi(int multi) fds=malloc(multi*sizeof *fds); for(n=0 ; n < multi ; ++n) { - pipe(fd); + if (pipe(fd) == -1) + { + fprintf(stderr, "pipe failure\n"); + exit(1); + } fflush(stdout); fflush(stderr); if(fork()) @@ -2779,7 +2783,11 @@ static int do_multi(int multi) { close(fd[0]); close(1); - dup(fd[1]); + if (dup(fd[1]) == -1) + { + fprintf(stderr, "dup failed\n"); + exit(1); + } close(fd[1]); mr=1; usertime=0; |
