Latest update.
This commit is contained in:
+2
-2
@@ -1557,7 +1557,7 @@ CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr)
|
||||
#else
|
||||
BIO_snprintf(buf, sizeof(buf), "%s-attr", dbfile);
|
||||
#endif
|
||||
dbattr_conf = app_load_config(buf);
|
||||
dbattr_conf = app_load_config_quiet(buf);
|
||||
|
||||
retdb = app_malloc(sizeof(*retdb), "new DB");
|
||||
retdb->db = tmpdb;
|
||||
@@ -2192,7 +2192,7 @@ double app_tminterval(int stop, int usertime)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#elif defined(OPENSSL_SYSTEM_VXWORKS)
|
||||
#elif defined(OPENSSL_SYS_VXWORKS)
|
||||
# include <time.h>
|
||||
|
||||
double app_tminterval(int stop, int usertime)
|
||||
|
||||
+5
-2
@@ -12,7 +12,7 @@
|
||||
our @apps_init_src = split(/\s+/, $target{apps_init_src});
|
||||
"" -}
|
||||
IF[{- !$disabled{apps} -}]
|
||||
LIBS_NO_INST=libapps.a
|
||||
LIBS{noinst}=libapps.a
|
||||
SOURCE[libapps.a]={- join(" ", @apps_lib_src) -}
|
||||
INCLUDE[libapps.a]=.. ../include
|
||||
|
||||
@@ -32,7 +32,10 @@ ENDIF
|
||||
GENERATE[progs.h]=progs.pl $(APPS_OPENSSL)
|
||||
DEPEND[progs.h]=../configdata.pm
|
||||
|
||||
SCRIPTS=CA.pl tsget.pl
|
||||
SCRIPTS{misc}=CA.pl
|
||||
SOURCE[CA.pl]=CA.pl.in
|
||||
# linkname tells build files that a symbolic link or copy of this script
|
||||
# without extension must be installed as well. Unix or Unix lookalike only.
|
||||
SCRIPTS{misc,linkname=tsget}=tsget.pl
|
||||
SOURCE[tsget.pl]=tsget.in
|
||||
ENDIF
|
||||
+6
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2008-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -65,7 +65,7 @@ struct cms_key_param_st {
|
||||
typedef enum OPTION_choice {
|
||||
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
||||
OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_ENCRYPT,
|
||||
OPT_DECRYPT, OPT_SIGN, OPT_SIGN_RECEIPT, OPT_RESIGN,
|
||||
OPT_DECRYPT, OPT_SIGN, OPT_CADES, OPT_SIGN_RECEIPT, OPT_RESIGN,
|
||||
OPT_VERIFY, OPT_VERIFY_RETCODE, OPT_VERIFY_RECEIPT,
|
||||
OPT_CMSOUT, OPT_DATA_OUT, OPT_DATA_CREATE, OPT_DIGEST_VERIFY,
|
||||
OPT_DIGEST_CREATE, OPT_COMPRESS, OPT_UNCOMPRESS,
|
||||
@@ -102,6 +102,7 @@ const OPTIONS cms_options[] = {
|
||||
{"sign", OPT_SIGN, '-', "Sign message"},
|
||||
{"sign_receipt", OPT_SIGN_RECEIPT, '-', "Generate a signed receipt for the message"},
|
||||
{"resign", OPT_RESIGN, '-', "Resign a signed message"},
|
||||
{"cades", OPT_CADES, '-', "Include signer certificate digest"},
|
||||
{"verify", OPT_VERIFY, '-', "Verify signed message"},
|
||||
{"verify_retcode", OPT_VERIFY_RETCODE, '-'},
|
||||
{"verify_receipt", OPT_VERIFY_RECEIPT, '<'},
|
||||
@@ -326,6 +327,9 @@ int cms_main(int argc, char **argv)
|
||||
case OPT_BINARY:
|
||||
flags |= CMS_BINARY;
|
||||
break;
|
||||
case OPT_CADES:
|
||||
flags |= CMS_CADES;
|
||||
break;
|
||||
case OPT_KEYID:
|
||||
flags |= CMS_USE_KEYID;
|
||||
break;
|
||||
|
||||
+14
@@ -53,6 +53,20 @@ NON_EMPTY_TRANSLATION_UNIT
|
||||
# define LOG_ERR 2
|
||||
# endif
|
||||
|
||||
# if defined(OPENSSL_SYS_VXWORKS)
|
||||
/* not supported */
|
||||
int setpgid(pid_t pid, pid_t pgid)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return 0;
|
||||
}
|
||||
/* not supported */
|
||||
pid_t fork(void)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return (pid_t) -1;
|
||||
}
|
||||
# endif
|
||||
/* Maximum leeway in validity period: default 5 minutes */
|
||||
# define MAX_VALIDITY_PERIOD (5 * 60)
|
||||
|
||||
|
||||
@@ -51,6 +51,26 @@
|
||||
# endif
|
||||
# define MAX_COLLISIONS 256
|
||||
|
||||
# if defined(OPENSSL_SYS_VXWORKS)
|
||||
/*
|
||||
* VxWorks has no symbolic links
|
||||
*/
|
||||
|
||||
# define lstat(path, buf) stat(path, buf)
|
||||
|
||||
int symlink(const char *target, const char *linkpath)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
ssize_t readlink(const char *pathname, char *buf, size_t bufsiz)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
# endif
|
||||
|
||||
typedef struct hentry_st {
|
||||
struct hentry_st *next;
|
||||
char *filename;
|
||||
|
||||
+79
-8
@@ -74,6 +74,7 @@ static void print_stuff(BIO *berr, SSL *con, int full);
|
||||
static int ocsp_resp_cb(SSL *s, void *arg);
|
||||
#endif
|
||||
static int ldap_ExtendedResponse_parse(const char *buf, long rem);
|
||||
static char *base64encode (const void *buf, size_t len);
|
||||
|
||||
static int saved_errno;
|
||||
|
||||
@@ -590,7 +591,8 @@ typedef enum OPTION_choice {
|
||||
OPT_V_ENUM,
|
||||
OPT_X_ENUM,
|
||||
OPT_S_ENUM,
|
||||
OPT_FALLBACKSCSV, OPT_NOCMDS, OPT_PROXY, OPT_DANE_TLSA_DOMAIN,
|
||||
OPT_FALLBACKSCSV, OPT_NOCMDS, OPT_PROXY, OPT_PROXY_USER, OPT_PROXY_PASS,
|
||||
OPT_DANE_TLSA_DOMAIN,
|
||||
#ifndef OPENSSL_NO_CT
|
||||
OPT_CT, OPT_NOCT, OPT_CTLOG_FILE,
|
||||
#endif
|
||||
@@ -608,6 +610,8 @@ const OPTIONS s_client_options[] = {
|
||||
{"bind", OPT_BIND, 's', "bind local address for connection"},
|
||||
{"proxy", OPT_PROXY, 's',
|
||||
"Connect to via specified proxy to the real server"},
|
||||
{"proxy_user", OPT_PROXY_USER, 's', "UserID for proxy authentication"},
|
||||
{"proxy_pass", OPT_PROXY_PASS, 's', "Proxy authentication password source"},
|
||||
#ifdef AF_UNIX
|
||||
{"unix", OPT_UNIX, 's', "Connect over the specified Unix-domain socket"},
|
||||
#endif
|
||||
@@ -894,8 +898,10 @@ int s_client_main(int argc, char **argv)
|
||||
STACK_OF(X509_CRL) *crls = NULL;
|
||||
const SSL_METHOD *meth = TLS_client_method();
|
||||
const char *CApath = NULL, *CAfile = NULL;
|
||||
char *cbuf = NULL, *sbuf = NULL;
|
||||
char *mbuf = NULL, *proxystr = NULL, *connectstr = NULL, *bindstr = NULL;
|
||||
char *cbuf = NULL, *sbuf = NULL, *mbuf = NULL;
|
||||
char *proxystr = NULL, *proxyuser = NULL;
|
||||
char *proxypassarg = NULL, *proxypass = NULL;
|
||||
char *connectstr = NULL, *bindstr = NULL;
|
||||
char *cert_file = NULL, *key_file = NULL, *chain_file = NULL;
|
||||
char *chCApath = NULL, *chCAfile = NULL, *host = NULL;
|
||||
char *port = OPENSSL_strdup(PORT);
|
||||
@@ -1075,6 +1081,12 @@ int s_client_main(int argc, char **argv)
|
||||
proxystr = opt_arg();
|
||||
starttls_proto = PROTO_CONNECT;
|
||||
break;
|
||||
case OPT_PROXY_USER:
|
||||
proxyuser = opt_arg();
|
||||
break;
|
||||
case OPT_PROXY_PASS:
|
||||
proxypassarg = opt_arg();
|
||||
break;
|
||||
#ifdef AF_UNIX
|
||||
case OPT_UNIX:
|
||||
connect_type = use_unix;
|
||||
@@ -1619,7 +1631,17 @@ int s_client_main(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
if (!app_passwd(passarg, NULL, &pass, NULL)) {
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
BIO_printf(bio_err, "Error getting private key password\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!app_passwd(proxypassarg, NULL, &proxypass, NULL)) {
|
||||
BIO_printf(bio_err, "Error getting proxy password\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (proxypass != NULL && proxyuser == NULL) {
|
||||
BIO_printf(bio_err, "Error: Must specify proxy_user with proxy_pass\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -2322,7 +2344,33 @@ int s_client_main(int argc, char **argv)
|
||||
BIO *fbio = BIO_new(BIO_f_buffer());
|
||||
|
||||
BIO_push(fbio, sbio);
|
||||
BIO_printf(fbio, "CONNECT %s HTTP/1.0\r\n\r\n", connectstr);
|
||||
BIO_printf(fbio, "CONNECT %s HTTP/1.0\r\n", connectstr);
|
||||
/*
|
||||
* Workaround for broken proxies which would otherwise close
|
||||
* the connection when entering tunnel mode (eg Squid 2.6)
|
||||
*/
|
||||
BIO_printf(fbio, "Proxy-Connection: Keep-Alive\r\n");
|
||||
|
||||
/* Support for basic (base64) proxy authentication */
|
||||
if (proxyuser != NULL) {
|
||||
size_t l;
|
||||
char *proxyauth, *proxyauthenc;
|
||||
|
||||
l = strlen(proxyuser);
|
||||
if (proxypass != NULL)
|
||||
l += strlen(proxypass);
|
||||
proxyauth = app_malloc(l + 2, "Proxy auth string");
|
||||
BIO_snprintf(proxyauth, l + 2, "%s:%s", proxyuser,
|
||||
(proxypass != NULL) ? proxypass : "");
|
||||
proxyauthenc = base64encode(proxyauth, strlen(proxyauth));
|
||||
BIO_printf(fbio, "Proxy-Authorization: Basic %s\r\n",
|
||||
proxyauthenc);
|
||||
OPENSSL_clear_free(proxyauth, strlen(proxyauth));
|
||||
OPENSSL_clear_free(proxyauthenc, strlen(proxyauthenc));
|
||||
}
|
||||
|
||||
/* Terminate the HTTP CONNECT request */
|
||||
BIO_printf(fbio, "\r\n");
|
||||
(void)BIO_flush(fbio);
|
||||
/*
|
||||
* The first line is the HTTP response. According to RFC 7230,
|
||||
@@ -3035,9 +3083,7 @@ int s_client_main(int argc, char **argv)
|
||||
BIO_printf(bio_err, "RENEGOTIATING\n");
|
||||
SSL_renegotiate(con);
|
||||
cbuf_len = 0;
|
||||
}
|
||||
|
||||
if (!c_ign_eof && (cbuf[0] == 'K' || cbuf[0] == 'k' )
|
||||
} else if (!c_ign_eof && (cbuf[0] == 'K' || cbuf[0] == 'k' )
|
||||
&& cmdletters) {
|
||||
BIO_printf(bio_err, "KEYUPDATE\n");
|
||||
SSL_key_update(con,
|
||||
@@ -3128,6 +3174,8 @@ int s_client_main(int argc, char **argv)
|
||||
OPENSSL_clear_free(cbuf, BUFSIZZ);
|
||||
OPENSSL_clear_free(sbuf, BUFSIZZ);
|
||||
OPENSSL_clear_free(mbuf, BUFSIZZ);
|
||||
if (proxypass != NULL)
|
||||
OPENSSL_clear_free(proxypass, strlen(proxypass));
|
||||
release_engine(e);
|
||||
BIO_free(bio_c_out);
|
||||
bio_c_out = NULL;
|
||||
@@ -3467,4 +3515,27 @@ static int ldap_ExtendedResponse_parse(const char *buf, long rem)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* BASE64 encoder: used only for encoding basic proxy authentication credentials
|
||||
*/
|
||||
static char *base64encode (const void *buf, size_t len)
|
||||
{
|
||||
int i;
|
||||
size_t outl;
|
||||
char *out;
|
||||
|
||||
/* Calculate size of encoded data */
|
||||
outl = (len / 3);
|
||||
if (len % 3 > 0)
|
||||
outl++;
|
||||
outl <<= 2;
|
||||
out = app_malloc(outl + 1, "base64 encode buffer");
|
||||
|
||||
i = EVP_EncodeBlock((unsigned char *)out, buf, len);
|
||||
assert(i <= (int)outl);
|
||||
if (i < 0)
|
||||
*out = '\0';
|
||||
return out;
|
||||
}
|
||||
|
||||
#endif /* OPENSSL_NO_SOCK */
|
||||
+3
-3
@@ -100,7 +100,7 @@
|
||||
#include <openssl/modes.h>
|
||||
|
||||
#ifndef HAVE_FORK
|
||||
# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS)
|
||||
# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_VXWORKS)
|
||||
# define HAVE_FORK 0
|
||||
# else
|
||||
# define HAVE_FORK 1
|
||||
@@ -1522,11 +1522,11 @@ int speed_main(int argc, char **argv)
|
||||
{"nistp192", NID_X9_62_prime192v1, 192},
|
||||
{"nistp224", NID_secp224r1, 224},
|
||||
{"nistp256", NID_X9_62_prime256v1, 256},
|
||||
{"nistp384", NID_secp384r1, 384},
|
||||
{"nistp384", NID_secp384r1, 384},
|
||||
{"nistp521", NID_secp521r1, 521},
|
||||
/* Binary Curves */
|
||||
{"nistk163", NID_sect163k1, 163},
|
||||
{"nistk233", NID_sect233k1, 233},
|
||||
{"nistk233", NID_sect233k1, 233},
|
||||
{"nistk283", NID_sect283k1, 283},
|
||||
{"nistk409", NID_sect409k1, 409},
|
||||
{"nistk571", NID_sect571k1, 571},
|
||||
|
||||
Reference in New Issue
Block a user