Compare commits
97 Commits
OpenSSL_1_
...
OpenSSL_1_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bee980bb5 | ||
|
|
7fa5428558 | ||
|
|
b9c9cd3ded | ||
|
|
8250e1b232 | ||
|
|
519c977c47 | ||
|
|
123370fb94 | ||
|
|
c97e457d53 | ||
|
|
f4e6ed09e4 | ||
|
|
b79e6e3a27 | ||
|
|
812b7246d4 | ||
|
|
db305124f3 | ||
|
|
bffbaf92bf | ||
|
|
5aca5d41c0 | ||
|
|
8343e6b6b2 | ||
|
|
f87c6a551e | ||
|
|
268ae49453 | ||
|
|
6270d1c086 | ||
|
|
5b54d26830 | ||
|
|
fccbab6f31 | ||
|
|
caf4e91a35 | ||
|
|
c01a838d62 | ||
|
|
66d3fb6af0 | ||
|
|
92e2dc11f3 | ||
|
|
5bcb4be17d | ||
|
|
dd9d9056cb | ||
|
|
44f28dd1e6 | ||
|
|
3f2959beee | ||
|
|
30e9cbe792 | ||
|
|
5b7f4c718f | ||
|
|
cb8044f032 | ||
|
|
7bca2646b5 | ||
|
|
edc2df54b9 | ||
|
|
365e872fa1 | ||
|
|
b3edc5fdb1 | ||
|
|
f7c4fe519b | ||
|
|
92c2c6e88c | ||
|
|
12cbba0d54 | ||
|
|
f9f6befa1f | ||
|
|
0552cbcdaa | ||
|
|
c3cd9be01f | ||
|
|
9f4a47b3ed | ||
|
|
51080676f1 | ||
|
|
1535ff91e1 | ||
|
|
79c8c47d5c | ||
|
|
84fe686173 | ||
|
|
44ea88c26e | ||
|
|
f4e6975590 | ||
|
|
3dd101aa4d | ||
|
|
ba44b8d42e | ||
|
|
7cdbce53f1 | ||
|
|
1ff9f2eed3 | ||
|
|
ee30926671 | ||
|
|
3d50fef7d7 | ||
|
|
33c162301a | ||
|
|
3abcf477a9 | ||
|
|
986fa907ae | ||
|
|
e4e1b8f230 | ||
|
|
da8f10881e | ||
|
|
ebbbc8bd1c | ||
|
|
bddd6e3495 | ||
|
|
6fc530e6a0 | ||
|
|
d24e8ac25b | ||
|
|
06e17142fc | ||
|
|
f82596346b | ||
|
|
38b4d7aab1 | ||
|
|
f16fede1cd | ||
|
|
4a15b7c625 | ||
|
|
065b75d3b7 | ||
|
|
75c3073bbf | ||
|
|
5762c18517 | ||
|
|
6a1dd28576 | ||
|
|
0737acd2a8 | ||
|
|
2198be3483 | ||
|
|
6fe498497c | ||
|
|
ce2c6d8452 | ||
|
|
e67c71c8fd | ||
|
|
ffa0e16198 | ||
|
|
910b3a81fd | ||
|
|
24a47191f3 | ||
|
|
4ba2edd2a5 | ||
|
|
4f5b7a76da | ||
|
|
8fe4d5bedb | ||
|
|
d43301b77a | ||
|
|
4727d57400 | ||
|
|
b815ab2101 | ||
|
|
ffaebdf38c | ||
|
|
8e04001f85 | ||
|
|
0450d6c177 | ||
|
|
745929c2a5 | ||
|
|
158d061609 | ||
|
|
16d616756f | ||
|
|
9fe6acbd1d | ||
|
|
5df832293e | ||
|
|
317ed9abdb | ||
|
|
080ae68432 | ||
|
|
6c6f6c44e5 | ||
|
|
11d31c00ad |
@@ -10,13 +10,18 @@ OpenSSL project.
|
||||
We would like to identify and thank the following such sponsors for their past
|
||||
or current significant support of the OpenSSL project:
|
||||
|
||||
Major support:
|
||||
|
||||
Qualys http://www.qualys.com/
|
||||
|
||||
Very significant support:
|
||||
|
||||
OpenGear: www.opengear.com
|
||||
OpenGear: http://www.opengear.com/
|
||||
|
||||
Significant support:
|
||||
|
||||
PSW Group: www.psw.net
|
||||
PSW Group: http://www.psw.net/
|
||||
Acano Ltd. http://acano.com/
|
||||
|
||||
Please note that we ask permission to identify sponsors and that some sponsors
|
||||
we consider eligible for inclusion here have requested to remain anonymous.
|
||||
|
||||
53
CHANGES
53
CHANGES
@@ -2,6 +2,59 @@
|
||||
OpenSSL CHANGES
|
||||
_______________
|
||||
|
||||
Changes between 1.0.0l and 1.0.0m [5 Jun 2014]
|
||||
|
||||
*) Fix for SSL/TLS MITM flaw. An attacker using a carefully crafted
|
||||
handshake can force the use of weak keying material in OpenSSL
|
||||
SSL/TLS clients and servers.
|
||||
|
||||
Thanks to KIKUCHI Masashi (Lepidum Co. Ltd.) for discovering and
|
||||
researching this issue. (CVE-2014-0224)
|
||||
[KIKUCHI Masashi, Steve Henson]
|
||||
|
||||
*) Fix DTLS recursion flaw. By sending an invalid DTLS handshake to an
|
||||
OpenSSL DTLS client the code can be made to recurse eventually crashing
|
||||
in a DoS attack.
|
||||
|
||||
Thanks to Imre Rad (Search-Lab Ltd.) for discovering this issue.
|
||||
(CVE-2014-0221)
|
||||
[Imre Rad, Steve Henson]
|
||||
|
||||
*) Fix DTLS invalid fragment vulnerability. A buffer overrun attack can
|
||||
be triggered by sending invalid DTLS fragments to an OpenSSL DTLS
|
||||
client or server. This is potentially exploitable to run arbitrary
|
||||
code on a vulnerable client or server.
|
||||
|
||||
Thanks to J<>ri Aedla for reporting this issue. (CVE-2014-0195)
|
||||
[J<>ri Aedla, Steve Henson]
|
||||
|
||||
*) Fix bug in TLS code where clients enable anonymous ECDH ciphersuites
|
||||
are subject to a denial of service attack.
|
||||
|
||||
Thanks to Felix Gr<47>bert and Ivan Fratric at Google for discovering
|
||||
this issue. (CVE-2014-3470)
|
||||
[Felix Gr<47>bert, Ivan Fratric, Steve Henson]
|
||||
|
||||
*) Harmonize version and its documentation. -f flag is used to display
|
||||
compilation flags.
|
||||
[mancha <mancha1@zoho.com>]
|
||||
|
||||
*) Fix eckey_priv_encode so it immediately returns an error upon a failure
|
||||
in i2d_ECPrivateKey.
|
||||
[mancha <mancha1@zoho.com>]
|
||||
|
||||
*) Fix some double frees. These are not thought to be exploitable.
|
||||
[mancha <mancha1@zoho.com>]
|
||||
|
||||
*) Fix for the attack described in the paper "Recovering OpenSSL
|
||||
ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack"
|
||||
by Yuval Yarom and Naomi Benger. Details can be obtained from:
|
||||
http://eprint.iacr.org/2014/140
|
||||
|
||||
Thanks to Yuval Yarom and Naomi Benger for discovering this
|
||||
flaw and to Yuval Yarom for supplying a fix (CVE-2014-0076)
|
||||
[Yuval Yarom and Naomi Benger]
|
||||
|
||||
Changes between 1.0.0k and 1.0.0l [6 Jan 2014]
|
||||
|
||||
*) Keep original DTLS digest and encryption contexts in retransmission
|
||||
|
||||
3
FAQ
3
FAQ
@@ -768,6 +768,9 @@ openssl-security@openssl.org if you don't get a prompt reply at least
|
||||
acknowledging receipt then resend or mail it directly to one of the
|
||||
more active team members (e.g. Steve).
|
||||
|
||||
Note that bugs only present in the openssl utility are not in general
|
||||
considered to be security issues.
|
||||
|
||||
[PROG] ========================================================================
|
||||
|
||||
* Is OpenSSL thread-safe?
|
||||
|
||||
9
NEWS
9
NEWS
@@ -5,6 +5,15 @@
|
||||
This file gives a brief overview of the major changes between each OpenSSL
|
||||
release. For more details please read the CHANGES file.
|
||||
|
||||
Major changes between OpenSSL 1.0.0l and OpenSSL 1.0.0m [5 Jun 2014]
|
||||
|
||||
o Fix for CVE-2014-0224
|
||||
o Fix for CVE-2014-0221
|
||||
o Fix for CVE-2014-0195
|
||||
o Fix for CVE-2014-3470
|
||||
o Fix for CVE-2014-0076
|
||||
o Fix for CVE-2010-5298
|
||||
|
||||
Major changes between OpenSSL 1.0.0k and OpenSSL 1.0.0l [6 Jan 2014]
|
||||
|
||||
o Fix for DTLS retransmission bug CVE-2013-6450
|
||||
|
||||
2
README
2
README
@@ -1,5 +1,5 @@
|
||||
|
||||
OpenSSL 1.0.0l 6 Jan 2014
|
||||
OpenSSL 1.0.0m 5 Jun 2014
|
||||
|
||||
Copyright (c) 1998-2011 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
|
||||
@@ -586,12 +586,12 @@ int password_callback(char *buf, int bufsiz, int verify,
|
||||
|
||||
if (ok >= 0)
|
||||
ok = UI_add_input_string(ui,prompt,ui_flags,buf,
|
||||
PW_MIN_LENGTH,BUFSIZ-1);
|
||||
PW_MIN_LENGTH,bufsiz-1);
|
||||
if (ok >= 0 && verify)
|
||||
{
|
||||
buff = (char *)OPENSSL_malloc(bufsiz);
|
||||
ok = UI_add_verify_string(ui,prompt,ui_flags,buff,
|
||||
PW_MIN_LENGTH,BUFSIZ-1, buf);
|
||||
PW_MIN_LENGTH,bufsiz-1, buf);
|
||||
}
|
||||
if (ok >= 0)
|
||||
do
|
||||
@@ -2772,7 +2772,7 @@ double app_tminterval(int stop,int usertime)
|
||||
|
||||
if (proc==NULL)
|
||||
{
|
||||
if (GetVersion() < 0x80000000)
|
||||
if (check_winnt())
|
||||
proc = OpenProcess(PROCESS_QUERY_INFORMATION,FALSE,
|
||||
GetCurrentProcessId());
|
||||
if (proc==NULL) proc = (HANDLE)-1;
|
||||
|
||||
18
apps/crl.c
18
apps/crl.c
@@ -81,6 +81,9 @@ static const char *crl_usage[]={
|
||||
" -in arg - input file - default stdin\n",
|
||||
" -out arg - output file - default stdout\n",
|
||||
" -hash - print hash value\n",
|
||||
#ifndef OPENSSL_NO_MD5
|
||||
" -hash_old - print old-style (MD5) hash value\n",
|
||||
#endif
|
||||
" -fingerprint - print the crl fingerprint\n",
|
||||
" -issuer - print issuer DN\n",
|
||||
" -lastupdate - lastUpdate field\n",
|
||||
@@ -108,6 +111,9 @@ int MAIN(int argc, char **argv)
|
||||
int informat,outformat;
|
||||
char *infile=NULL,*outfile=NULL;
|
||||
int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0;
|
||||
#ifndef OPENSSL_NO_MD5
|
||||
int hash_old=0;
|
||||
#endif
|
||||
int fingerprint = 0, crlnumber = 0;
|
||||
const char **pp;
|
||||
X509_STORE *store = NULL;
|
||||
@@ -192,6 +198,10 @@ int MAIN(int argc, char **argv)
|
||||
text = 1;
|
||||
else if (strcmp(*argv,"-hash") == 0)
|
||||
hash= ++num;
|
||||
#ifndef OPENSSL_NO_MD5
|
||||
else if (strcmp(*argv,"-hash_old") == 0)
|
||||
hash_old= ++num;
|
||||
#endif
|
||||
else if (strcmp(*argv,"-nameopt") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -304,6 +314,14 @@ bad:
|
||||
BIO_printf(bio_out,"%08lx\n",
|
||||
X509_NAME_hash(X509_CRL_get_issuer(x)));
|
||||
}
|
||||
#ifndef OPENSSL_NO_MD5
|
||||
if (hash_old == i)
|
||||
{
|
||||
BIO_printf(bio_out,"%08lx\n",
|
||||
X509_NAME_hash_old(
|
||||
X509_CRL_get_issuer(x)));
|
||||
}
|
||||
#endif
|
||||
if (lastupdate == i)
|
||||
{
|
||||
BIO_printf(bio_out,"lastUpdate=");
|
||||
|
||||
@@ -415,9 +415,9 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
if (do_verify)
|
||||
r = EVP_DigestVerifyInit(mctx, &pctx, md, e, sigkey);
|
||||
r = EVP_DigestVerifyInit(mctx, &pctx, md, NULL, sigkey);
|
||||
else
|
||||
r = EVP_DigestSignInit(mctx, &pctx, md, e, sigkey);
|
||||
r = EVP_DigestSignInit(mctx, &pctx, md, NULL, sigkey);
|
||||
if (!r)
|
||||
{
|
||||
BIO_printf(bio_err, "Error setting context\n");
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
* in the asn1 der encoding
|
||||
* possible values: named_curve (default)
|
||||
* explicit
|
||||
* -no_seed - if 'explicit' parameters are choosen do not use the seed
|
||||
* -no_seed - if 'explicit' parameters are chosen do not use the seed
|
||||
* -genkey - generate ec key
|
||||
* -rand file - files to use for random number input
|
||||
* -engine e - use engine e, possibly a hardware device
|
||||
@@ -286,7 +286,7 @@ bad:
|
||||
BIO_printf(bio_err, " "
|
||||
" explicit\n");
|
||||
BIO_printf(bio_err, " -no_seed if 'explicit'"
|
||||
" parameters are choosen do not"
|
||||
" parameters are chosen do not"
|
||||
" use the seed\n");
|
||||
BIO_printf(bio_err, " -genkey generate ec"
|
||||
" key\n");
|
||||
|
||||
22
apps/ocsp.c
22
apps/ocsp.c
@@ -127,6 +127,7 @@ int MAIN(int argc, char **argv)
|
||||
ENGINE *e = NULL;
|
||||
char **args;
|
||||
char *host = NULL, *port = NULL, *path = "/";
|
||||
char *thost = NULL, *tport = NULL, *tpath = NULL;
|
||||
char *reqin = NULL, *respin = NULL;
|
||||
char *reqout = NULL, *respout = NULL;
|
||||
char *signfile = NULL, *keyfile = NULL;
|
||||
@@ -204,6 +205,12 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
else if (!strcmp(*args, "-url"))
|
||||
{
|
||||
if (thost)
|
||||
OPENSSL_free(thost);
|
||||
if (tport)
|
||||
OPENSSL_free(tport);
|
||||
if (tpath)
|
||||
OPENSSL_free(tpath);
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
@@ -212,6 +219,9 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err, "Error parsing URL\n");
|
||||
badarg = 1;
|
||||
}
|
||||
thost = host;
|
||||
tport = port;
|
||||
tpath = path;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
@@ -920,12 +930,12 @@ end:
|
||||
sk_X509_pop_free(verify_other, X509_free);
|
||||
sk_CONF_VALUE_pop_free(headers, X509V3_conf_free);
|
||||
|
||||
if (use_ssl != -1)
|
||||
{
|
||||
OPENSSL_free(host);
|
||||
OPENSSL_free(port);
|
||||
OPENSSL_free(path);
|
||||
}
|
||||
if (thost)
|
||||
OPENSSL_free(thost);
|
||||
if (tport)
|
||||
OPENSSL_free(tport);
|
||||
if (tpath)
|
||||
OPENSSL_free(tpath);
|
||||
|
||||
OPENSSL_EXIT(ret);
|
||||
}
|
||||
|
||||
28
apps/req.c
28
apps/req.c
@@ -635,6 +635,11 @@ bad:
|
||||
if (inrand)
|
||||
app_RAND_load_files(inrand);
|
||||
|
||||
if (!NCONF_get_number(req_conf,SECTION,BITS, &newkey))
|
||||
{
|
||||
newkey=DEFAULT_KEY_LENGTH;
|
||||
}
|
||||
|
||||
if (keyalg)
|
||||
{
|
||||
genctx = set_keygen_ctx(bio_err, keyalg, &pkey_type, &newkey,
|
||||
@@ -643,12 +648,6 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (newkey <= 0)
|
||||
{
|
||||
if (!NCONF_get_number(req_conf,SECTION,BITS, &newkey))
|
||||
newkey=DEFAULT_KEY_LENGTH;
|
||||
}
|
||||
|
||||
if (newkey < MIN_KEY_LENGTH && (pkey_type == EVP_PKEY_RSA || pkey_type == EVP_PKEY_DSA))
|
||||
{
|
||||
BIO_printf(bio_err,"private key length is too short,\n");
|
||||
@@ -1477,7 +1476,13 @@ start:
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ebcdic2ascii(buf, buf, i);
|
||||
#endif
|
||||
if(!req_check_len(i, n_min, n_max)) goto start;
|
||||
if(!req_check_len(i, n_min, n_max))
|
||||
{
|
||||
if (batch || value)
|
||||
return 0;
|
||||
goto start;
|
||||
}
|
||||
|
||||
if (!X509_NAME_add_entry_by_NID(n,nid, chtype,
|
||||
(unsigned char *) buf, -1,-1,mval)) goto err;
|
||||
ret=1;
|
||||
@@ -1536,7 +1541,12 @@ start:
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ebcdic2ascii(buf, buf, i);
|
||||
#endif
|
||||
if(!req_check_len(i, n_min, n_max)) goto start;
|
||||
if(!req_check_len(i, n_min, n_max))
|
||||
{
|
||||
if (batch || value)
|
||||
return 0;
|
||||
goto start;
|
||||
}
|
||||
|
||||
if(!X509_REQ_add1_attr_by_NID(req, nid, chtype,
|
||||
(unsigned char *)buf, -1)) {
|
||||
@@ -1636,6 +1646,8 @@ static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type,
|
||||
keylen = atol(p + 1);
|
||||
*pkeylen = keylen;
|
||||
}
|
||||
else
|
||||
keylen = *pkeylen;
|
||||
}
|
||||
else if (p)
|
||||
paramfile = p + 1;
|
||||
|
||||
@@ -275,7 +275,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
|
||||
{
|
||||
i=0;
|
||||
i=setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i));
|
||||
if (i < 0) { perror("keepalive"); return(0); }
|
||||
if (i < 0) { closesocket(s); perror("keepalive"); return(0); }
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -451,6 +451,7 @@ redoit:
|
||||
if ((*host=(char *)OPENSSL_malloc(strlen(h1->h_name)+1)) == NULL)
|
||||
{
|
||||
perror("OPENSSL_malloc");
|
||||
closesocket(ret);
|
||||
return(0);
|
||||
}
|
||||
BUF_strlcpy(*host,h1->h_name,strlen(h1->h_name)+1);
|
||||
@@ -459,11 +460,13 @@ redoit:
|
||||
if (h2 == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"gethostbyname failure\n");
|
||||
closesocket(ret);
|
||||
return(0);
|
||||
}
|
||||
if (h2->h_addrtype != AF_INET)
|
||||
{
|
||||
BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n");
|
||||
closesocket(ret);
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,8 +541,8 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
if (!cipher)
|
||||
{
|
||||
#ifndef OPENSSL_NO_RC2
|
||||
cipher = EVP_rc2_40_cbc();
|
||||
#ifndef OPENSSL_NO_DES
|
||||
cipher = EVP_des_ede3_cbc();
|
||||
#else
|
||||
BIO_printf(bio_err, "No cipher selected\n");
|
||||
goto end;
|
||||
|
||||
@@ -74,7 +74,7 @@ static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
|
||||
* certain software (e.g. Netscape) has problems with them.
|
||||
*/
|
||||
|
||||
static unsigned long global_mask = 0xFFFFFFFFL;
|
||||
static unsigned long global_mask = B_ASN1_UTF8STRING;
|
||||
|
||||
void ASN1_STRING_set_default_mask(unsigned long mask)
|
||||
{
|
||||
|
||||
@@ -302,7 +302,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
|
||||
{ERR_REASON(ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE),"unknown public key type"},
|
||||
{ERR_REASON(ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM),"unknown signature algorithm"},
|
||||
{ERR_REASON(ASN1_R_UNKNOWN_TAG) ,"unknown tag"},
|
||||
{ERR_REASON(ASN1_R_UNKOWN_FORMAT) ,"unkown format"},
|
||||
{ERR_REASON(ASN1_R_UNKOWN_FORMAT) ,"unknown format"},
|
||||
{ERR_REASON(ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE),"unsupported any defined by type"},
|
||||
{ERR_REASON(ASN1_R_UNSUPPORTED_CIPHER) ,"unsupported cipher"},
|
||||
{ERR_REASON(ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM),"unsupported encryption algorithm"},
|
||||
|
||||
@@ -245,7 +245,7 @@ static int MS_CALLBACK slg_puts(BIO *bp, const char *str)
|
||||
|
||||
static void xopenlog(BIO* bp, char* name, int level)
|
||||
{
|
||||
if (GetVersion() < 0x80000000)
|
||||
if (check_winnt())
|
||||
bp->ptr = RegisterEventSourceA(NULL,name);
|
||||
else
|
||||
bp->ptr = NULL;
|
||||
|
||||
@@ -538,6 +538,8 @@ BIGNUM *BN_mod_inverse(BIGNUM *ret,
|
||||
BIGNUM *BN_mod_sqrt(BIGNUM *ret,
|
||||
const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
|
||||
|
||||
void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
|
||||
|
||||
/* Deprecated versions */
|
||||
#ifndef OPENSSL_NO_DEPRECATED
|
||||
BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe,
|
||||
@@ -759,11 +761,20 @@ int RAND_pseudo_bytes(unsigned char *buf,int num);
|
||||
|
||||
#define bn_fix_top(a) bn_check_top(a)
|
||||
|
||||
#define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2)
|
||||
#define bn_wcheck_size(bn, words) \
|
||||
do { \
|
||||
const BIGNUM *_bnum2 = (bn); \
|
||||
assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \
|
||||
} while(0)
|
||||
|
||||
#else /* !BN_DEBUG */
|
||||
|
||||
#define bn_pollute(a)
|
||||
#define bn_check_top(a)
|
||||
#define bn_fix_top(a) bn_correct_top(a)
|
||||
#define bn_check_size(bn, bits)
|
||||
#define bn_wcheck_size(bn, words)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -843,3 +843,55 @@ int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b,
|
||||
}
|
||||
return bn_cmp_words(a,b,cl);
|
||||
}
|
||||
|
||||
/*
|
||||
* Constant-time conditional swap of a and b.
|
||||
* a and b are swapped if condition is not 0. The code assumes that at most one bit of condition is set.
|
||||
* nwords is the number of words to swap. The code assumes that at least nwords are allocated in both a and b,
|
||||
* and that no more than nwords are used by either a or b.
|
||||
* a and b cannot be the same number
|
||||
*/
|
||||
void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
|
||||
{
|
||||
BN_ULONG t;
|
||||
int i;
|
||||
|
||||
bn_wcheck_size(a, nwords);
|
||||
bn_wcheck_size(b, nwords);
|
||||
|
||||
assert(a != b);
|
||||
assert((condition & (condition - 1)) == 0);
|
||||
assert(sizeof(BN_ULONG) >= sizeof(int));
|
||||
|
||||
condition = ((condition - 1) >> (BN_BITS2 - 1)) - 1;
|
||||
|
||||
t = (a->top^b->top) & condition;
|
||||
a->top ^= t;
|
||||
b->top ^= t;
|
||||
|
||||
#define BN_CONSTTIME_SWAP(ind) \
|
||||
do { \
|
||||
t = (a->d[ind] ^ b->d[ind]) & condition; \
|
||||
a->d[ind] ^= t; \
|
||||
b->d[ind] ^= t; \
|
||||
} while (0)
|
||||
|
||||
|
||||
switch (nwords) {
|
||||
default:
|
||||
for (i = 10; i < nwords; i++)
|
||||
BN_CONSTTIME_SWAP(i);
|
||||
/* Fallthrough */
|
||||
case 10: BN_CONSTTIME_SWAP(9); /* Fallthrough */
|
||||
case 9: BN_CONSTTIME_SWAP(8); /* Fallthrough */
|
||||
case 8: BN_CONSTTIME_SWAP(7); /* Fallthrough */
|
||||
case 7: BN_CONSTTIME_SWAP(6); /* Fallthrough */
|
||||
case 6: BN_CONSTTIME_SWAP(5); /* Fallthrough */
|
||||
case 5: BN_CONSTTIME_SWAP(4); /* Fallthrough */
|
||||
case 4: BN_CONSTTIME_SWAP(3); /* Fallthrough */
|
||||
case 3: BN_CONSTTIME_SWAP(2); /* Fallthrough */
|
||||
case 2: BN_CONSTTIME_SWAP(1); /* Fallthrough */
|
||||
case 1: BN_CONSTTIME_SWAP(0);
|
||||
}
|
||||
#undef BN_CONSTTIME_SWAP
|
||||
}
|
||||
|
||||
@@ -536,32 +536,38 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from)
|
||||
BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
|
||||
const BIGNUM *mod, BN_CTX *ctx)
|
||||
{
|
||||
int got_write_lock = 0;
|
||||
BN_MONT_CTX *ret;
|
||||
|
||||
CRYPTO_r_lock(lock);
|
||||
if (!*pmont)
|
||||
{
|
||||
CRYPTO_r_unlock(lock);
|
||||
CRYPTO_w_lock(lock);
|
||||
got_write_lock = 1;
|
||||
|
||||
if (!*pmont)
|
||||
{
|
||||
ret = BN_MONT_CTX_new();
|
||||
if (ret && !BN_MONT_CTX_set(ret, mod, ctx))
|
||||
BN_MONT_CTX_free(ret);
|
||||
else
|
||||
*pmont = ret;
|
||||
}
|
||||
}
|
||||
|
||||
ret = *pmont;
|
||||
|
||||
if (got_write_lock)
|
||||
CRYPTO_w_unlock(lock);
|
||||
CRYPTO_r_unlock(lock);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* We don't want to serialise globally while doing our lazy-init math in
|
||||
* BN_MONT_CTX_set. That punishes threads that are doing independent
|
||||
* things. Instead, punish the case where more than one thread tries to
|
||||
* lazy-init the same 'pmont', by having each do the lazy-init math work
|
||||
* independently and only use the one from the thread that wins the race
|
||||
* (the losers throw away the work they've done). */
|
||||
ret = BN_MONT_CTX_new();
|
||||
if (!ret)
|
||||
return NULL;
|
||||
if (!BN_MONT_CTX_set(ret, mod, ctx))
|
||||
{
|
||||
BN_MONT_CTX_free(ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* The locked compare-and-set, after the local work is done. */
|
||||
CRYPTO_w_lock(lock);
|
||||
if (*pmont)
|
||||
{
|
||||
BN_MONT_CTX_free(ret);
|
||||
ret = *pmont;
|
||||
}
|
||||
else
|
||||
CRYPTO_r_unlock(lock);
|
||||
|
||||
*pmont = ret;
|
||||
CRYPTO_w_unlock(lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -186,6 +186,8 @@ CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
|
||||
if (flags & CMS_USE_KEYID)
|
||||
{
|
||||
ktri->version = 2;
|
||||
if (env->version < 2)
|
||||
env->version = 2;
|
||||
type = CMS_RECIPINFO_KEYIDENTIFIER;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -466,8 +466,6 @@ int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert)
|
||||
STACK_OF(CMS_CertificateChoices) **pcerts;
|
||||
int i;
|
||||
pcerts = cms_get0_certificate_choices(cms);
|
||||
if (!pcerts)
|
||||
return 0;
|
||||
if (!pcerts)
|
||||
return 0;
|
||||
for (i = 0; i < sk_CMS_CertificateChoices_num(*pcerts); i++)
|
||||
|
||||
@@ -158,8 +158,8 @@ static void cms_sd_set_version(CMS_SignedData *sd)
|
||||
if (sd->version < 3)
|
||||
sd->version = 3;
|
||||
}
|
||||
else
|
||||
sd->version = 1;
|
||||
else if (si->version < 1)
|
||||
si->version = 1;
|
||||
}
|
||||
|
||||
if (sd->version < 1)
|
||||
|
||||
@@ -611,7 +611,7 @@ int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert)
|
||||
STACK_OF(CMS_RecipientInfo) *ris;
|
||||
CMS_RecipientInfo *ri;
|
||||
int i, r;
|
||||
int debug = 0;
|
||||
int debug = 0, ri_match = 0;
|
||||
ris = CMS_get0_RecipientInfos(cms);
|
||||
if (ris)
|
||||
debug = cms->d.envelopedData->encryptedContentInfo->debug;
|
||||
@@ -620,6 +620,7 @@ int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert)
|
||||
ri = sk_CMS_RecipientInfo_value(ris, i);
|
||||
if (CMS_RecipientInfo_type(ri) != CMS_RECIPINFO_TRANS)
|
||||
continue;
|
||||
ri_match = 1;
|
||||
/* If we have a cert try matching RecipientInfo
|
||||
* otherwise try them all.
|
||||
*/
|
||||
@@ -655,7 +656,7 @@ int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert)
|
||||
}
|
||||
}
|
||||
/* If no cert and not debugging always return success */
|
||||
if (!cert && !debug)
|
||||
if (ri_match && !cert && !debug)
|
||||
{
|
||||
ERR_clear_error();
|
||||
return 1;
|
||||
|
||||
@@ -860,7 +860,7 @@ void OPENSSL_showfatal (const char *fmta,...)
|
||||
|
||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333
|
||||
/* this -------------v--- guards NT-specific calls */
|
||||
if (GetVersion() < 0x80000000 && OPENSSL_isservice() > 0)
|
||||
if (check_winnt() && OPENSSL_isservice() > 0)
|
||||
{ HANDLE h = RegisterEventSource(0,_T("OPENSSL"));
|
||||
const TCHAR *pmsg=buf;
|
||||
ReportEvent(h,EVENTLOG_ERROR_TYPE,0,0,0,1,0,&pmsg,0);
|
||||
|
||||
@@ -463,7 +463,7 @@ static int dlfcn_pathbyaddr(void *addr,char *path,int sz)
|
||||
return len;
|
||||
}
|
||||
|
||||
ERR_add_error_data(4, "dlfcn_pathbyaddr(): ", dlerror());
|
||||
ERR_add_error_data(2, "dlfcn_pathbyaddr(): ", dlerror());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,14 @@
|
||||
#include <errno.h>
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/dso.h>
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
DSO_METHOD *DSO_METHOD_vms(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
|
||||
#pragma message disable DOLLARID
|
||||
#include <rms.h>
|
||||
#include <lib$routines.h>
|
||||
@@ -69,7 +76,6 @@
|
||||
#include <descrip.h>
|
||||
#include <starlet.h>
|
||||
#include "vms_rms.h"
|
||||
#endif
|
||||
|
||||
/* Some compiler options may mask the declaration of "_malloc32". */
|
||||
#if __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE
|
||||
@@ -82,12 +88,6 @@
|
||||
#endif /* __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE */
|
||||
|
||||
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
DSO_METHOD *DSO_METHOD_vms(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
#pragma message disable DOLLARID
|
||||
|
||||
static int vms_load(DSO *dso);
|
||||
|
||||
@@ -206,11 +206,15 @@ static int gf2m_Mxy(const EC_GROUP *group, const BIGNUM *x, const BIGNUM *y, BIG
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* Computes scalar*point and stores the result in r.
|
||||
* point can not equal r.
|
||||
* Uses algorithm 2P of
|
||||
* Uses a modified algorithm 2P of
|
||||
* Lopez, J. and Dahab, R. "Fast multiplication on elliptic curves over
|
||||
* GF(2^m) without precomputation" (CHES '99, LNCS 1717).
|
||||
*
|
||||
* To protect against side-channel attack the function uses constant time swap,
|
||||
* avoiding conditional branches.
|
||||
*/
|
||||
static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
|
||||
const EC_POINT *point, BN_CTX *ctx)
|
||||
@@ -244,6 +248,11 @@ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r,
|
||||
x2 = &r->X;
|
||||
z2 = &r->Y;
|
||||
|
||||
bn_wexpand(x1, group->field.top);
|
||||
bn_wexpand(z1, group->field.top);
|
||||
bn_wexpand(x2, group->field.top);
|
||||
bn_wexpand(z2, group->field.top);
|
||||
|
||||
if (!BN_GF2m_mod_arr(x1, &point->X, group->poly)) goto err; /* x1 = x */
|
||||
if (!BN_one(z1)) goto err; /* z1 = 1 */
|
||||
if (!group->meth->field_sqr(group, z2, x1, ctx)) goto err; /* z2 = x1^2 = x^2 */
|
||||
@@ -268,16 +277,12 @@ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r,
|
||||
word = scalar->d[i];
|
||||
while (mask)
|
||||
{
|
||||
if (word & mask)
|
||||
{
|
||||
if (!gf2m_Madd(group, &point->X, x1, z1, x2, z2, ctx)) goto err;
|
||||
if (!gf2m_Mdouble(group, x2, z2, ctx)) goto err;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx)) goto err;
|
||||
if (!gf2m_Mdouble(group, x1, z1, ctx)) goto err;
|
||||
}
|
||||
BN_consttime_swap(word & mask, x1, x2, group->field.top);
|
||||
BN_consttime_swap(word & mask, z1, z2, group->field.top);
|
||||
if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx)) goto err;
|
||||
if (!gf2m_Mdouble(group, x1, z1, ctx)) goto err;
|
||||
BN_consttime_swap(word & mask, x1, x2, group->field.top);
|
||||
BN_consttime_swap(word & mask, z1, z2, group->field.top);
|
||||
mask >>= 1;
|
||||
}
|
||||
mask = BN_TBIT;
|
||||
|
||||
@@ -352,6 +352,7 @@ static int eckey_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
|
||||
EC_KEY_set_enc_flags(ec_key, old_flags);
|
||||
OPENSSL_free(ep);
|
||||
ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_EC_LIB);
|
||||
return 0;
|
||||
}
|
||||
/* restore old encoding flags */
|
||||
EC_KEY_set_enc_flags(ec_key, old_flags);
|
||||
|
||||
@@ -1419,8 +1419,11 @@ int i2o_ECPublicKey(EC_KEY *a, unsigned char **out)
|
||||
*out, buf_len, NULL))
|
||||
{
|
||||
ECerr(EC_F_I2O_ECPUBLICKEY, ERR_R_EC_LIB);
|
||||
OPENSSL_free(*out);
|
||||
*out = NULL;
|
||||
if (new_buffer)
|
||||
{
|
||||
OPENSSL_free(*out);
|
||||
*out = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (!new_buffer)
|
||||
|
||||
@@ -188,7 +188,7 @@ static int pkey_ec_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)
|
||||
|
||||
pubkey = EC_KEY_get0_public_key(ctx->peerkey->pkey.ec);
|
||||
|
||||
/* NB: unlike PKS#3 DH, if *outlen is less than maximum size this is
|
||||
/* NB: unlike PKCS#3 DH, if *outlen is less than maximum size this is
|
||||
* not an error, the result is truncated.
|
||||
*/
|
||||
|
||||
|
||||
@@ -408,6 +408,7 @@ ENGINE *ENGINE_by_id(const char *id)
|
||||
!ENGINE_ctrl_cmd_string(iterator, "DIR_LOAD", "2", 0) ||
|
||||
!ENGINE_ctrl_cmd_string(iterator, "DIR_ADD",
|
||||
load_dir, 0) ||
|
||||
!ENGINE_ctrl_cmd_string(iterator, "LIST_ADD", "1", 0) ||
|
||||
!ENGINE_ctrl_cmd_string(iterator, "LOAD", NULL, 0))
|
||||
goto notfound;
|
||||
return iterator;
|
||||
|
||||
@@ -226,6 +226,7 @@ static int b64_read(BIO *b, char *out, int outl)
|
||||
else if (ctx->start)
|
||||
{
|
||||
q=p=(unsigned char *)ctx->tmp;
|
||||
num = 0;
|
||||
for (j=0; j<i; j++)
|
||||
{
|
||||
if (*(q++) != '\n') continue;
|
||||
@@ -264,7 +265,7 @@ static int b64_read(BIO *b, char *out, int outl)
|
||||
}
|
||||
|
||||
/* we fell off the end without starting */
|
||||
if (j == i)
|
||||
if ((j == i) && (num == 0))
|
||||
{
|
||||
/* Is this is one long chunk?, if so, keep on
|
||||
* reading until a new line. */
|
||||
|
||||
@@ -324,6 +324,7 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
|
||||
v=EVP_DecodeBlock(out,d,n);
|
||||
n=0;
|
||||
if (v < 0) { rv=0; goto end; }
|
||||
if (eof > v) { rv=-1; goto end; }
|
||||
ret+=(v-eof);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -121,7 +121,7 @@ void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
|
||||
unsigned char ivec[16], block128_f block)
|
||||
{
|
||||
size_t n;
|
||||
union { size_t align; unsigned char c[16]; } tmp;
|
||||
union { size_t t[16/sizeof(size_t)]; unsigned char c[16]; } tmp;
|
||||
|
||||
assert(in && out && key && ivec);
|
||||
|
||||
@@ -141,11 +141,13 @@ void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
|
||||
out += 16;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (16%sizeof(size_t) == 0) { /* always true */
|
||||
while (len>=16) {
|
||||
size_t *out_t=(size_t *)out, *iv_t=(size_t *)iv;
|
||||
|
||||
(*block)(in, out, key);
|
||||
for(n=0; n<16; n+=sizeof(size_t))
|
||||
*(size_t *)(out+n) ^= *(size_t *)(iv+n);
|
||||
for(n=0; n<16/sizeof(size_t); n++)
|
||||
out_t[n] ^= iv_t[n];
|
||||
iv = in;
|
||||
len -= 16;
|
||||
in += 16;
|
||||
@@ -169,15 +171,16 @@ void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
|
||||
out += 16;
|
||||
}
|
||||
}
|
||||
else {
|
||||
size_t c;
|
||||
else if (16%sizeof(size_t) == 0) { /* always true */
|
||||
while (len>=16) {
|
||||
size_t c, *out_t=(size_t *)out, *ivec_t=(size_t *)ivec;
|
||||
const size_t *in_t=(const size_t *)in;
|
||||
|
||||
(*block)(in, tmp.c, key);
|
||||
for(n=0; n<16; n+=sizeof(size_t)) {
|
||||
c = *(size_t *)(in+n);
|
||||
*(size_t *)(out+n) =
|
||||
*(size_t *)(tmp.c+n) ^ *(size_t *)(ivec+n);
|
||||
*(size_t *)(ivec+n) = c;
|
||||
for(n=0; n<16/sizeof(size_t); n++) {
|
||||
c = in_t[n];
|
||||
out_t[n] = tmp.t[n] ^ ivec_t[n];
|
||||
ivec_t[n] = c;
|
||||
}
|
||||
len -= 16;
|
||||
in += 16;
|
||||
|
||||
@@ -78,12 +78,8 @@ size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
(*cbc)(in,out-16,residue,key,ivec,1);
|
||||
memcpy(out,tmp.c,residue);
|
||||
#else
|
||||
{
|
||||
size_t n;
|
||||
for (n=0; n<16; n+=sizeof(size_t))
|
||||
*(size_t *)(tmp.c+n) = 0;
|
||||
memset(tmp.c,0,sizeof(tmp));
|
||||
memcpy(tmp.c,in,residue);
|
||||
}
|
||||
memcpy(out,out-16,residue);
|
||||
(*cbc)(tmp.c,out-16,16,key,ivec,1);
|
||||
#endif
|
||||
@@ -112,8 +108,7 @@ size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, unsigned char *out,
|
||||
|
||||
(*block)(in,tmp.c+16,key);
|
||||
|
||||
for (n=0; n<16; n+=sizeof(size_t))
|
||||
*(size_t *)(tmp.c+n) = *(size_t *)(tmp.c+16+n);
|
||||
memcpy(tmp.c,tmp.c+16,16);
|
||||
memcpy(tmp.c,in+16,residue);
|
||||
(*block)(tmp.c,tmp.c,key);
|
||||
|
||||
@@ -131,7 +126,7 @@ size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, unsigned char *out,
|
||||
size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const void *key,
|
||||
unsigned char ivec[16], cbc128_f cbc)
|
||||
{ size_t residue, n;
|
||||
{ size_t residue;
|
||||
union { size_t align; unsigned char c[32]; } tmp;
|
||||
|
||||
assert (in && out && key && ivec);
|
||||
@@ -148,8 +143,7 @@ size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
|
||||
out += len;
|
||||
}
|
||||
|
||||
for (n=16; n<32; n+=sizeof(size_t))
|
||||
*(size_t *)(tmp.c+n) = 0;
|
||||
memset(tmp.c,0,sizeof(tmp));
|
||||
/* this places in[16] at &tmp.c[16] and decrypted block at &tmp.c[0] */
|
||||
(*cbc)(in,tmp.c,16,key,tmp.c+16,0);
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
|
||||
* major minor fix final patch/beta)
|
||||
*/
|
||||
#define OPENSSL_VERSION_NUMBER 0x100000cfL
|
||||
#define OPENSSL_VERSION_NUMBER 0x100000dfL
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0l-fips 6 Jan 2014"
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0m-fips 5 Jun 2014"
|
||||
#else
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0l 6 Jan 2014"
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0m 5 Jun 2014"
|
||||
#endif
|
||||
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
|
||||
|
||||
|
||||
@@ -90,7 +90,11 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
|
||||
|
||||
/* Set defaults */
|
||||
if (!nid_cert)
|
||||
#ifdef OPENSSL_NO_RC2
|
||||
nid_cert = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||
#else
|
||||
nid_cert = NID_pbe_WithSHA1And40BitRC2_CBC;
|
||||
#endif
|
||||
if (!nid_key)
|
||||
nid_key = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||
if (!iter)
|
||||
@@ -279,7 +283,11 @@ int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
|
||||
free_safes = 0;
|
||||
|
||||
if (nid_safe == 0)
|
||||
#ifdef OPENSSL_NO_RC2
|
||||
nid_safe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||
#else
|
||||
nid_safe = NID_pbe_WithSHA1And40BitRC2_CBC;
|
||||
#endif
|
||||
|
||||
if (nid_safe == -1)
|
||||
p7 = PKCS12_pack_p7data(bags);
|
||||
|
||||
@@ -269,7 +269,7 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen,
|
||||
int len, r;
|
||||
unsigned char *data;
|
||||
len = ASN1_STRING_to_UTF8(&data, fname);
|
||||
if(len > 0) {
|
||||
if(len >= 0) {
|
||||
r = X509_alias_set1(x509, data, len);
|
||||
OPENSSL_free(data);
|
||||
if (!r)
|
||||
|
||||
@@ -440,6 +440,11 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
|
||||
{
|
||||
case NID_pkcs7_signed:
|
||||
data_body=PKCS7_get_octet_string(p7->d.sign->contents);
|
||||
if (!PKCS7_is_detached(p7) && data_body == NULL)
|
||||
{
|
||||
PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_INVALID_SIGNED_DATA_TYPE);
|
||||
goto err;
|
||||
}
|
||||
md_sk=p7->d.sign->md_algs;
|
||||
break;
|
||||
case NID_pkcs7_signedAndEnveloped:
|
||||
@@ -922,6 +927,7 @@ int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si)
|
||||
if (EVP_DigestSignUpdate(&mctx,abuf,alen) <= 0)
|
||||
goto err;
|
||||
OPENSSL_free(abuf);
|
||||
abuf = NULL;
|
||||
if (EVP_DigestSignFinal(&mctx, NULL, &siglen) <= 0)
|
||||
goto err;
|
||||
abuf = OPENSSL_malloc(siglen);
|
||||
|
||||
@@ -89,13 +89,10 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
|
||||
goto err;
|
||||
}
|
||||
|
||||
if(!(flags & PKCS7_NOCERTS))
|
||||
for(i = 0; i < sk_X509_num(certs); i++)
|
||||
{
|
||||
for(i = 0; i < sk_X509_num(certs); i++)
|
||||
{
|
||||
if (!PKCS7_add_certificate(p7, sk_X509_value(certs, i)))
|
||||
goto err;
|
||||
}
|
||||
if (!PKCS7_add_certificate(p7, sk_X509_value(certs, i)))
|
||||
goto err;
|
||||
}
|
||||
|
||||
if(flags & PKCS7_DETACHED)
|
||||
|
||||
@@ -453,6 +453,7 @@ void ERR_load_PKCS7_strings(void);
|
||||
#define PKCS7_R_ERROR_SETTING_CIPHER 121
|
||||
#define PKCS7_R_INVALID_MIME_TYPE 131
|
||||
#define PKCS7_R_INVALID_NULL_POINTER 143
|
||||
#define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155
|
||||
#define PKCS7_R_MIME_NO_CONTENT_TYPE 132
|
||||
#define PKCS7_R_MIME_PARSE_ERROR 133
|
||||
#define PKCS7_R_MIME_SIG_PARSE_ERROR 134
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* crypto/pkcs7/pkcs7err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2014 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -130,6 +130,7 @@ static ERR_STRING_DATA PKCS7_str_reasons[]=
|
||||
{ERR_REASON(PKCS7_R_ERROR_SETTING_CIPHER),"error setting cipher"},
|
||||
{ERR_REASON(PKCS7_R_INVALID_MIME_TYPE) ,"invalid mime type"},
|
||||
{ERR_REASON(PKCS7_R_INVALID_NULL_POINTER),"invalid null pointer"},
|
||||
{ERR_REASON(PKCS7_R_INVALID_SIGNED_DATA_TYPE),"invalid signed data type"},
|
||||
{ERR_REASON(PKCS7_R_MIME_NO_CONTENT_TYPE),"mime no content type"},
|
||||
{ERR_REASON(PKCS7_R_MIME_PARSE_ERROR) ,"mime parse error"},
|
||||
{ERR_REASON(PKCS7_R_MIME_SIG_PARSE_ERROR),"mime sig parse error"},
|
||||
|
||||
@@ -750,7 +750,7 @@ static void readscreen(void)
|
||||
int y; /* y-coordinate of screen lines to grab */
|
||||
int n = 16; /* number of screen lines to grab at a time */
|
||||
|
||||
if (GetVersion() < 0x80000000 && OPENSSL_isservice()>0)
|
||||
if (check_winnt() && OPENSSL_isservice()>0)
|
||||
return;
|
||||
|
||||
/* Create a screen DC and a memory DC compatible to screen DC */
|
||||
|
||||
@@ -186,6 +186,13 @@
|
||||
#undef ssl_parse_serverhello_renegotiate_ext
|
||||
#define ssl_parse_serverhello_renegotiate_ext ssl_parse_serverhello_reneg_ext
|
||||
|
||||
#undef ssl3_cbc_record_digest_supported
|
||||
#define ssl3_cbc_record_digest_supported ssl3_cbc_record_digest_support
|
||||
#undef ssl_check_clienthello_tlsext_late
|
||||
#define ssl_check_clienthello_tlsext_late ssl_check_clihello_tlsext_late
|
||||
#undef ssl_check_clienthello_tlsext_early
|
||||
#define ssl_check_clienthello_tlsext_early ssl_check_clihello_tlsext_early
|
||||
|
||||
/* Hack some long ENGINE names */
|
||||
#undef ENGINE_get_default_BN_mod_exp_crt
|
||||
#define ENGINE_get_default_BN_mod_exp_crt ENGINE_get_def_BN_mod_exp_crt
|
||||
|
||||
@@ -626,6 +626,7 @@ static int TS_compute_imprint(BIO *data, TS_TST_INFO *tst_info,
|
||||
X509_ALGOR_free(*md_alg);
|
||||
OPENSSL_free(*imprint);
|
||||
*imprint_len = 0;
|
||||
*imprint = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
|
||||
|
||||
s=dir;
|
||||
p=s;
|
||||
for (;;p++)
|
||||
do
|
||||
{
|
||||
if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0'))
|
||||
{
|
||||
@@ -264,9 +264,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (*p == '\0')
|
||||
break;
|
||||
}
|
||||
} while (*p++ != '\0');
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1462,10 +1462,9 @@ static int cert_crl(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x)
|
||||
* a certificate was revoked. This has since been changed since
|
||||
* critical extension can change the meaning of CRL entries.
|
||||
*/
|
||||
if (crl->flags & EXFLAG_CRITICAL)
|
||||
if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
|
||||
&& (crl->flags & EXFLAG_CRITICAL))
|
||||
{
|
||||
if (ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
|
||||
return 1;
|
||||
ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION;
|
||||
ok = ctx->verify_cb(0, ctx);
|
||||
if(!ok)
|
||||
|
||||
@@ -389,8 +389,8 @@ static void x509v3_cache_extensions(X509 *x)
|
||||
/* Handle proxy certificates */
|
||||
if((pci=X509_get_ext_d2i(x, NID_proxyCertInfo, NULL, NULL))) {
|
||||
if (x->ex_flags & EXFLAG_CA
|
||||
|| X509_get_ext_by_NID(x, NID_subject_alt_name, 0) >= 0
|
||||
|| X509_get_ext_by_NID(x, NID_issuer_alt_name, 0) >= 0) {
|
||||
|| X509_get_ext_by_NID(x, NID_subject_alt_name, -1) >= 0
|
||||
|| X509_get_ext_by_NID(x, NID_issuer_alt_name, -1) >= 0) {
|
||||
x->ex_flags |= EXFLAG_INVALID;
|
||||
}
|
||||
if (pci->pcPathLengthConstraint) {
|
||||
@@ -670,7 +670,7 @@ static int check_purpose_timestamp_sign(const X509_PURPOSE *xp, const X509 *x,
|
||||
return 0;
|
||||
|
||||
/* Extended Key Usage MUST be critical */
|
||||
i_ext = X509_get_ext_by_NID((X509 *) x, NID_ext_key_usage, 0);
|
||||
i_ext = X509_get_ext_by_NID((X509 *) x, NID_ext_key_usage, -1);
|
||||
if (i_ext >= 0)
|
||||
{
|
||||
X509_EXTENSION *ext = X509_get_ext((X509 *) x, i_ext);
|
||||
|
||||
@@ -10,7 +10,7 @@ int main(int argc, char **argv)
|
||||
int ret = 1;
|
||||
|
||||
/*
|
||||
* On OpenSSL 0.9.9 only:
|
||||
* On OpenSSL 1.0.0+ only:
|
||||
* for streaming set CMS_STREAM
|
||||
*/
|
||||
int flags = CMS_STREAM;
|
||||
|
||||
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
|
||||
goto err;
|
||||
|
||||
/* Decrypt S/MIME message */
|
||||
if (!CMS_decrypt(cms, rkey, rcert, out, NULL, 0))
|
||||
if (!CMS_decrypt(cms, rkey, rcert, NULL, out, 0))
|
||||
goto err;
|
||||
|
||||
ret = 0;
|
||||
|
||||
@@ -12,7 +12,7 @@ int main(int argc, char **argv)
|
||||
int ret = 1;
|
||||
|
||||
/* For simple S/MIME signing use CMS_DETACHED.
|
||||
* On OpenSSL 0.9.9 only:
|
||||
* On OpenSSL 1.0.0 only:
|
||||
* for streaming detached set CMS_DETACHED|CMS_STREAM
|
||||
* for streaming non-detached set CMS_STREAM
|
||||
*/
|
||||
|
||||
@@ -90,6 +90,11 @@ decrypt mail using the supplied certificate and private key. Expects an
|
||||
encrypted mail message in MIME format for the input file. The decrypted mail
|
||||
is written to the output file.
|
||||
|
||||
=item B<-debug_decrypt>
|
||||
|
||||
this option sets the B<CMS_DEBUG_DECRYPT> flag. This option should be used
|
||||
with caution: see the notes section below.
|
||||
|
||||
=item B<-sign>
|
||||
|
||||
sign mail using the supplied certificate and private key. Input file is
|
||||
@@ -446,32 +451,42 @@ Streaming is always used for the B<-sign> operation with detached data but
|
||||
since the content is no longer part of the CMS structure the encoding
|
||||
remains DER.
|
||||
|
||||
If the B<-decrypt> option is used without a recipient certificate then an
|
||||
attempt is made to locate the recipient by trying each potential recipient
|
||||
in turn using the supplied private key. To thwart the MMA attack
|
||||
(Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) all recipients are
|
||||
tried whether they succeed or not and if no recipients match the message
|
||||
is "decrypted" using a random key which will typically output garbage.
|
||||
The B<-debug_decrypt> option can be used to disable the MMA attack protection
|
||||
and return an error if no recipient can be found: this option should be used
|
||||
with caution. For a fuller description see L<CMS_decrypt(3)|CMS_decrypt(3)>).
|
||||
|
||||
=head1 EXIT CODES
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
the operation was completely successfully.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
an error occurred parsing the command options.
|
||||
|
||||
=item 2
|
||||
=item Z<>2
|
||||
|
||||
one of the input files could not be read.
|
||||
|
||||
=item 3
|
||||
=item Z<>3
|
||||
|
||||
an error occurred creating the CMS file or when reading the MIME
|
||||
message.
|
||||
|
||||
=item 4
|
||||
=item Z<>4
|
||||
|
||||
an error occurred decrypting or verifying the message.
|
||||
|
||||
=item 5
|
||||
=item Z<>5
|
||||
|
||||
the message was verified correctly but an error occurred writing out
|
||||
the signers certificates.
|
||||
|
||||
@@ -119,7 +119,7 @@ variable points to a section containing further ENGINE configuration
|
||||
information.
|
||||
|
||||
The section pointed to by B<engines> is a table of engine names (though see
|
||||
B<engine_id> below) and further sections containing configuration informations
|
||||
B<engine_id> below) and further sections containing configuration information
|
||||
specific to each ENGINE.
|
||||
|
||||
Each ENGINE specific section is used to set default algorithms, load
|
||||
|
||||
@@ -62,6 +62,11 @@ don't output the encoded version of the CRL.
|
||||
output a hash of the issuer name. This can be use to lookup CRLs in
|
||||
a directory by issuer name.
|
||||
|
||||
=item B<-hash_old>
|
||||
|
||||
outputs the "hash" of the CRL issuer name using the older algorithm
|
||||
as used by OpenSSL versions before 1.0.0.
|
||||
|
||||
=item B<-issuer>
|
||||
|
||||
output the issuer name.
|
||||
|
||||
@@ -41,7 +41,7 @@ PKCS#8 private key format use the B<pkcs8> command.
|
||||
|
||||
This specifies the input format. The B<DER> option with a private key uses
|
||||
an ASN.1 DER encoded SEC1 private key. When used with a public key it
|
||||
uses the SubjectPublicKeyInfo structur as specified in RFC 3280.
|
||||
uses the SubjectPublicKeyInfo structure as specified in RFC 3280.
|
||||
The B<PEM> form is the default format: it consists of the B<DER> format base64
|
||||
encoded with additional header and footer lines. In the case of a private key
|
||||
PKCS#8 format is also accepted.
|
||||
|
||||
@@ -114,6 +114,8 @@ hexadecimal value if preceded by B<0x>. Default value is 65537.
|
||||
|
||||
The number of bits in the generated parameters. If not specified 1024 is used.
|
||||
|
||||
=back
|
||||
|
||||
=head1 DH PARAMETER GENERATION OPTIONS
|
||||
|
||||
=over 4
|
||||
|
||||
@@ -287,8 +287,6 @@ SHA Digest
|
||||
|
||||
SHA-1 Digest
|
||||
|
||||
=back
|
||||
|
||||
=item B<sha224>
|
||||
|
||||
SHA-224 Digest
|
||||
@@ -305,6 +303,8 @@ SHA-384 Digest
|
||||
|
||||
SHA-512 Digest
|
||||
|
||||
=back
|
||||
|
||||
=head2 ENCODING AND CIPHER COMMANDS
|
||||
|
||||
=over 10
|
||||
|
||||
@@ -67,7 +67,7 @@ by default.
|
||||
The filename to write certificates and private keys to, standard output by
|
||||
default. They are all written in PEM format.
|
||||
|
||||
=item B<-pass arg>, B<-passin arg>
|
||||
=item B<-passin arg>
|
||||
|
||||
the PKCS#12 file (i.e. input file) password source. For more information about
|
||||
the format of B<arg> see the B<PASS PHRASE ARGUMENTS> section in
|
||||
@@ -75,10 +75,15 @@ L<openssl(1)|openssl(1)>.
|
||||
|
||||
=item B<-passout arg>
|
||||
|
||||
pass phrase source to encrypt any outputed private keys with. For more
|
||||
pass phrase source to encrypt any outputted private keys with. For more
|
||||
information about the format of B<arg> see the B<PASS PHRASE ARGUMENTS> section
|
||||
in L<openssl(1)|openssl(1)>.
|
||||
|
||||
=item B<-password arg>
|
||||
|
||||
With -export, -password is equivalent to -passout.
|
||||
Otherwise, -password is equivalent to -passin.
|
||||
|
||||
=item B<-noout>
|
||||
|
||||
this option inhibits output of the keys and certificates to the output file
|
||||
|
||||
@@ -303,7 +303,7 @@ Reverses effect of B<-asn1-kludge>
|
||||
|
||||
=item B<-newhdr>
|
||||
|
||||
Adds the word B<NEW> to the PEM file header and footer lines on the outputed
|
||||
Adds the word B<NEW> to the PEM file header and footer lines on the outputted
|
||||
request. Some software (Netscape certificate server) and some CAs need this.
|
||||
|
||||
=item B<-batch>
|
||||
|
||||
@@ -10,6 +10,7 @@ s_client - SSL/TLS client program
|
||||
B<openssl> B<s_client>
|
||||
[B<-connect host:port>]
|
||||
[B<-verify depth>]
|
||||
[B<-verify_return_error>]
|
||||
[B<-cert filename>]
|
||||
[B<-certform DER|PEM>]
|
||||
[B<-key filename>]
|
||||
@@ -90,6 +91,11 @@ Currently the verify operation continues after errors so all the problems
|
||||
with a certificate chain can be seen. As a side effect the connection
|
||||
will never fail due to a server certificate verify failure.
|
||||
|
||||
=item B<-verify_return_error>
|
||||
|
||||
Return verification errors instead of continuing. This will typically
|
||||
abort the handshake with a fatal error.
|
||||
|
||||
=item B<-CApath directory>
|
||||
|
||||
The directory to use for server certificate verification. This directory
|
||||
@@ -286,6 +292,13 @@ Since the SSLv23 client hello cannot include compression methods or extensions
|
||||
these will only be supported if its use is disabled, for example by using the
|
||||
B<-no_sslv2> option.
|
||||
|
||||
The B<s_client> utility is a test tool and is designed to continue the
|
||||
handshake after any certificate verification errors. As a result it will
|
||||
accept any certificate chain (trusted or not) sent by the peer. None test
|
||||
applications should B<not> do this as it makes them vulnerable to a MITM
|
||||
attack. This behaviour can be changed by with the B<-verify_return_error>
|
||||
option: any verify errors are then returned aborting the handshake.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
Because this program has a lot of options and also because some of
|
||||
@@ -293,9 +306,6 @@ the techniques used are rather old, the C source of s_client is rather
|
||||
hard to read and not a model of how things should be done. A typical
|
||||
SSL client program would be much simpler.
|
||||
|
||||
The B<-verify> option should really exit if the server verification
|
||||
fails.
|
||||
|
||||
The B<-prexit> option is a bit of a hack. We should really report
|
||||
information whenever a session is renegotiated.
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ B<openssl> B<s_server>
|
||||
[B<-no_ssl3>]
|
||||
[B<-no_tls1>]
|
||||
[B<-no_dhe>]
|
||||
[B<-no_ecdhe>]
|
||||
[B<-bugs>]
|
||||
[B<-hack>]
|
||||
[B<-www>]
|
||||
@@ -111,7 +112,7 @@ by using an appropriate certificate.
|
||||
|
||||
=item B<-dcertform format>, B<-dkeyform format>, B<-dpass arg>
|
||||
|
||||
addtional certificate and private key format and passphrase respectively.
|
||||
additional certificate and private key format and passphrase respectively.
|
||||
|
||||
=item B<-nocert>
|
||||
|
||||
@@ -131,6 +132,11 @@ a static set of parameters hard coded into the s_server program will be used.
|
||||
if this option is set then no DH parameters will be loaded effectively
|
||||
disabling the ephemeral DH cipher suites.
|
||||
|
||||
=item B<-no_ecdhe>
|
||||
|
||||
if this option is set then no ECDH parameters will be loaded effectively
|
||||
disabling the ephemeral ECDH cipher suites.
|
||||
|
||||
=item B<-no_tmp_rsa>
|
||||
|
||||
certain export cipher suites sometimes use a temporary RSA key, this option
|
||||
|
||||
@@ -159,7 +159,7 @@ EVP_get_cipherbyname() function) can also be used preceded by a dash, for
|
||||
example B<-aes_128_cbc>. See L<B<enc>|enc(1)> for list of ciphers
|
||||
supported by your version of OpenSSL.
|
||||
|
||||
If not specified 40 bit RC2 is used. Only used with B<-encrypt>.
|
||||
If not specified triple DES is used. Only used with B<-encrypt>.
|
||||
|
||||
=item B<-nointern>
|
||||
|
||||
@@ -308,28 +308,28 @@ remains DER.
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
the operation was completely successfully.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
an error occurred parsing the command options.
|
||||
|
||||
=item 2
|
||||
=item Z<>2
|
||||
|
||||
one of the input files could not be read.
|
||||
|
||||
=item 3
|
||||
=item Z<>3
|
||||
|
||||
an error occurred creating the PKCS#7 file or when reading the MIME
|
||||
message.
|
||||
|
||||
=item 4
|
||||
=item Z<>4
|
||||
|
||||
an error occurred decrypting or verifying the message.
|
||||
|
||||
=item 5
|
||||
=item Z<>5
|
||||
|
||||
the message was verified correctly but an error occurred writing out
|
||||
the signers certificates.
|
||||
|
||||
@@ -352,7 +352,7 @@ switch always overrides the settings in the config file.
|
||||
|
||||
This is the main section and it specifies the name of another section
|
||||
that contains all the options for the B<-reply> command. This default
|
||||
section can be overriden with the B<-section> command line switch. (Optional)
|
||||
section can be overridden with the B<-section> command line switch. (Optional)
|
||||
|
||||
=item B<oid_file>
|
||||
|
||||
@@ -453,7 +453,7 @@ included. Default is no. (Optional)
|
||||
=head1 ENVIRONMENT VARIABLES
|
||||
|
||||
B<OPENSSL_CONF> contains the path of the configuration file and can be
|
||||
overriden by the B<-config> command line option.
|
||||
overridden by the B<-config> command line option.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ The name of an EGD socket to get random data from. (Optional)
|
||||
=item [request]...
|
||||
|
||||
List of files containing B<RFC 3161> DER-encoded time stamp requests. If no
|
||||
requests are specifed only one request will be sent to the server and it will be
|
||||
requests are specified only one request will be sent to the server and it will be
|
||||
read from the standard input. (Optional)
|
||||
|
||||
=back
|
||||
|
||||
@@ -25,6 +25,7 @@ B<openssl> B<verify>
|
||||
[B<-untrusted file>]
|
||||
[B<-help>]
|
||||
[B<-issuer_checks>]
|
||||
[B<-attime timestamp>]
|
||||
[B<-verbose>]
|
||||
[B<->]
|
||||
[certificates]
|
||||
@@ -78,6 +79,12 @@ certificate was rejected. However the presence of rejection messages
|
||||
does not itself imply that anything is wrong: during the normal
|
||||
verify process several rejections may take place.
|
||||
|
||||
=item B<-attime timestamp>
|
||||
|
||||
Perform validation checks using time specified by B<timestamp> and not
|
||||
current system time. B<timestamp> is the number of seconds since
|
||||
01.01.1970 (UNIX time).
|
||||
|
||||
=item B<-policy arg>
|
||||
|
||||
Enable policy processing and add B<arg> to the user-initial-policy-set
|
||||
@@ -386,7 +393,7 @@ an application specific error. Unused.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
Although the issuer checks are a considerably improvement over the old technique they still
|
||||
Although the issuer checks are a considerable improvement over the old technique they still
|
||||
suffer from limitations in the underlying X509_LOOKUP API. One consequence of this is that
|
||||
trusted certificates with matching subject name must either appear in a file (as specified by the
|
||||
B<-CAfile> option) or a directory (as specified by B<-CApath>. If they occur in both then only
|
||||
|
||||
@@ -13,6 +13,7 @@ B<openssl version>
|
||||
[B<-o>]
|
||||
[B<-f>]
|
||||
[B<-p>]
|
||||
[B<-d>]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@@ -38,7 +39,7 @@ the date the current version of OpenSSL was built.
|
||||
|
||||
option information: various options set when the library was built.
|
||||
|
||||
=item B<-c>
|
||||
=item B<-f>
|
||||
|
||||
compilation flags.
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ Example:
|
||||
O=Organisation
|
||||
CN=Some Name
|
||||
|
||||
|
||||
|
||||
=head2 Certificate Policies.
|
||||
|
||||
This is a I<raw> extension. All the fields of this extension can be set by
|
||||
@@ -390,7 +390,7 @@ Examples:
|
||||
nameConstraints=permitted;email:.somedomain.com
|
||||
|
||||
nameConstraints=excluded;email:.com
|
||||
issuingDistributionPoint = idp_section
|
||||
|
||||
|
||||
=head2 OCSP No Check
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ necessary parameters are set, by re-creating the blinding parameters.
|
||||
|
||||
BN_BLINDING_convert_ex() multiplies B<n> with the blinding factor B<A>.
|
||||
If B<r> is not NULL a copy the inverse blinding factor B<Ai> will be
|
||||
returned in B<r> (this is useful if a B<RSA> object is shared amoung
|
||||
returned in B<r> (this is useful if a B<RSA> object is shared among
|
||||
several threads). BN_BLINDING_invert_ex() multiplies B<n> with the
|
||||
inverse blinding factor B<Ai>. If B<r> is not NULL it will be used as
|
||||
the inverse blinding.
|
||||
|
||||
@@ -27,7 +27,21 @@ function or errors about unknown algorithms will occur.
|
||||
|
||||
Although the recipients certificate is not needed to decrypt the data it is
|
||||
needed to locate the appropriate (of possible several) recipients in the CMS
|
||||
structure. If B<cert> is set to NULL all possible recipients are tried.
|
||||
structure.
|
||||
|
||||
If B<cert> is set to NULL all possible recipients are tried. This case however
|
||||
is problematic. To thwart the MMA attack (Bleichenbacher's attack on
|
||||
PKCS #1 v1.5 RSA padding) all recipients are tried whether they succeed or
|
||||
not. If no recipient succeeds then a random symmetric key is used to decrypt
|
||||
the content: this will typically output garbage and may (but is not guaranteed
|
||||
to) ultimately return a padding error only. If CMS_decrypt() just returned an
|
||||
error when all recipient encrypted keys failed to decrypt an attacker could
|
||||
use this in a timing attack. If the special flag B<CMS_DEBUG_DECRYPT> is set
|
||||
then the above behaviour is modified and an error B<is> returned if no
|
||||
recipient encrypted key can be decrypted B<without> generating a random
|
||||
content encryption key. Applications should use this flag with
|
||||
B<extreme caution> especially in automated gateways as it can leave them
|
||||
open to attack.
|
||||
|
||||
It is possible to determine the correct recipient key by other means (for
|
||||
example looking them up in a database) and setting them in the CMS structure
|
||||
|
||||
@@ -37,7 +37,7 @@ None of the functions return a value.
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<conf(5)|conf(5)>, L<OPENSSL_config(3)|OPENSSL_config(3)>,
|
||||
L<CONF_modules_load_file(3), CONF_modules_load_file(3)>
|
||||
L<CONF_modules_load_file(3)|CONF_modules_load_file(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ return value of the failing module (this will always be zero or negative).
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<conf(5)|conf(5)>, L<OPENSSL_config(3)|OPENSSL_config(3)>,
|
||||
L<CONF_free(3), CONF_free(3)>, L<err(3),err(3)>
|
||||
L<CONF_free(3)|CONF_free(3)>, L<err(3)|err(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -52,8 +52,11 @@ ERR_get_error_line_data(), ERR_peek_error_line_data() and
|
||||
ERR_get_last_error_line_data() store additional data and flags
|
||||
associated with the error code in *B<data>
|
||||
and *B<flags>, unless these are B<NULL>. *B<data> contains a string
|
||||
if *B<flags>&B<ERR_TXT_STRING>. If it has been allocated by OPENSSL_malloc(),
|
||||
*B<flags>&B<ERR_TXT_MALLOCED> is true.
|
||||
if *B<flags>&B<ERR_TXT_STRING> is true.
|
||||
|
||||
An application B<MUST NOT> free the *B<data> pointer (or any other pointers
|
||||
returned by these functions) with OPENSSL_free() as freeing is handled
|
||||
automatically by the error library.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ EVP_BytesToKey - password based encryption routine
|
||||
|
||||
EVP_BytesToKey() derives a key and IV from various parameters. B<type> is
|
||||
the cipher to derive the key and IV for. B<md> is the message digest to use.
|
||||
The B<salt> paramter is used as a salt in the derivation: it should point to
|
||||
The B<salt> parameter is used as a salt in the derivation: it should point to
|
||||
an 8 byte buffer or NULL if no salt is used. B<data> is a buffer containing
|
||||
B<datal> bytes which is used to derive the keying data. B<count> is the
|
||||
iteration count to use. The derived key and IV will be written to B<key>
|
||||
|
||||
@@ -152,7 +152,7 @@ does not remain in memory.
|
||||
|
||||
EVP_EncryptInit(), EVP_DecryptInit() and EVP_CipherInit() behave in a
|
||||
similar way to EVP_EncryptInit_ex(), EVP_DecryptInit_ex and
|
||||
EVP_CipherInit_ex() except the B<ctx> paramter does not need to be
|
||||
EVP_CipherInit_ex() except the B<ctx> parameter does not need to be
|
||||
initialized and they always use the default cipher implementation.
|
||||
|
||||
EVP_EncryptFinal(), EVP_DecryptFinal() and EVP_CipherFinal() behave in a
|
||||
|
||||
@@ -73,7 +73,7 @@ Neither OPENSSL_config() nor OPENSSL_no_config() return a value.
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<conf(5)|conf(5)>, L<CONF_load_modules_file(3)|CONF_load_modules_file(3)>,
|
||||
L<CONF_modules_free(3),CONF_modules_free(3)>
|
||||
L<CONF_modules_free(3)|CONF_modules_free(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ set first so the relevant field information can be looked up internally.
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509_NAME(3)|d2i_X509_NAME(3)>,
|
||||
L<OBJ_nid2obj(3),OBJ_nid2obj(3)>
|
||||
L<OBJ_nid2obj(3)|OBJ_nid2obj(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ X509_STORE_CTX_get_ex_new_index, X509_STORE_CTX_set_ex_data, X509_STORE_CTX_get_
|
||||
|
||||
int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *d, int idx, void *arg);
|
||||
|
||||
char *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *d, int idx);
|
||||
void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *d, int idx);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ a special status code is set to the verification callback. This permits it
|
||||
to examine the valid policy tree and perform additional checks or simply
|
||||
log it for debugging purposes.
|
||||
|
||||
By default some addtional features such as indirect CRLs and CRLs signed by
|
||||
By default some additional features such as indirect CRLs and CRLs signed by
|
||||
different keys are disabled. If B<X509_V_FLAG_EXTENDED_CRL_SUPPORT> is set
|
||||
they are enabled.
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ handle PKCS#8 format encrypted and unencrypted keys too.
|
||||
PEM_write_bio_PKCS8PrivateKey() and PEM_write_PKCS8PrivateKey()
|
||||
write a private key in an EVP_PKEY structure in PKCS#8
|
||||
EncryptedPrivateKeyInfo format using PKCS#5 v2.0 password based encryption
|
||||
algorithms. The B<cipher> argument specifies the encryption algoritm to
|
||||
algorithms. The B<cipher> argument specifies the encryption algorithm to
|
||||
use: unlike all other PEM routines the encryption is applied at the
|
||||
PKCS#8 level and not in the PEM headers. If B<cipher> is NULL then no
|
||||
encryption is used and a PKCS#8 PrivateKeyInfo structure is used instead.
|
||||
|
||||
@@ -21,6 +21,13 @@ pub 2048R/F295C759 1998-12-13
|
||||
Key fingerprint = D0 5D 8C 61 6E 27 E6 60 41 EC B1 B8 D5 7E E5 97
|
||||
uid Dr S N Henson <shenson@drh-consultancy.demon.co.uk>
|
||||
|
||||
pub 4096R/FA40E9E2 2005-03-19
|
||||
Key fingerprint = 6260 5AA4 334A F9F0 DDE5 D349 D357 7507 FA40 E9E2
|
||||
uid Dr Stephen Henson <shenson@opensslfoundation.com>
|
||||
uid Dr Stephen Henson <shenson@drh-consultancy.co.uk>
|
||||
uid Dr Stephen N Henson <steve@openssl.org>
|
||||
sub 4096R/8811F530 2005-03-19
|
||||
|
||||
pub 1024R/49A563D9 1997-02-24
|
||||
Key fingerprint = 7B 79 19 FA 71 6B 87 25 0E 77 21 E5 52 D9 83 BF
|
||||
uid Mark Cox <mjc@redhat.com>
|
||||
|
||||
@@ -53,11 +53,11 @@ SSL_COMP_add_compression_method() may return the following values:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The operation succeeded.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The operation failed. Check the error queue to find out the reason.
|
||||
|
||||
|
||||
@@ -52,13 +52,13 @@ The following values are returned by all functions:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The operation failed. In case of the add operation, it was tried to add
|
||||
the same (identical) session twice. In case of the remove operation, the
|
||||
session was not found in the cache.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The operation succeeded.
|
||||
|
||||
|
||||
@@ -100,13 +100,13 @@ The following return values can occur:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The operation failed because B<CAfile> and B<CApath> are NULL or the
|
||||
processing at one of the locations specified failed. Check the error
|
||||
stack to find out the reason.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The operation succeeded.
|
||||
|
||||
|
||||
@@ -66,13 +66,13 @@ values:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
A failure while manipulating the STACK_OF(X509_NAME) object occurred or
|
||||
the X509_NAME could not be extracted from B<cacert>. Check the error stack
|
||||
to find out the reason.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The operation succeeded.
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ SSL_CTX_set_msg_callback, SSL_CTX_set_msg_callback_arg, SSL_set_msg_callback, SS
|
||||
void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
|
||||
void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg);
|
||||
|
||||
void SSL_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
|
||||
void SSL_set_msg_callback_arg(SSL_CTX *ctx, void *arg);
|
||||
void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
|
||||
void SSL_set_msg_callback_arg(SSL *ssl, void *arg);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
|
||||
@@ -64,13 +64,13 @@ return the following values:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The length B<sid_ctx_len> of the session id context B<sid_ctx> exceeded
|
||||
the maximum allowed length of B<SSL_MAX_SSL_SESSION_ID_LENGTH>. The error
|
||||
is logged to the error stack.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The operation succeeded.
|
||||
|
||||
|
||||
@@ -42,11 +42,11 @@ and SSL_set_ssl_method():
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The new choice failed, check the error stack to find out the reason.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The operation succeeded.
|
||||
|
||||
|
||||
@@ -169,8 +169,8 @@ that will always continue the TLS/SSL handshake regardless of verification
|
||||
failure, if wished. The callback realizes a verification depth limit with
|
||||
more informational output.
|
||||
|
||||
All verification errors are printed, informations about the certificate chain
|
||||
are printed on request.
|
||||
All verification errors are printed; information about the certificate chain
|
||||
is printed on request.
|
||||
The example is realized for a server that does allow but not require client
|
||||
certificates.
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ data to B<psk> and return the length of the random data, so the
|
||||
connection will fail with decryption_error before it will be finished
|
||||
completely.
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
PSK identity was not found. An "unknown_psk_identity" alert message
|
||||
will be sent and the connection setup fails.
|
||||
|
||||
@@ -44,13 +44,13 @@ The following return values can occur:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The TLS/SSL handshake was not successful but was shut down controlled and
|
||||
by the specifications of the TLS/SSL protocol. Call SSL_get_error() with the
|
||||
return value B<ret> to find out the reason.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been
|
||||
established.
|
||||
|
||||
@@ -56,12 +56,12 @@ The following return values can occur:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The SSL_clear() operation could not be performed. Check the error stack to
|
||||
find out the reason.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The SSL_clear() operation was successful.
|
||||
|
||||
|
||||
@@ -41,13 +41,13 @@ The following return values can occur:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The TLS/SSL handshake was not successful but was shut down controlled and
|
||||
by the specifications of the TLS/SSL protocol. Call SSL_get_error() with the
|
||||
return value B<ret> to find out the reason.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been
|
||||
established.
|
||||
|
||||
@@ -45,13 +45,13 @@ The following return values can occur:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The TLS/SSL handshake was not successful but was shut down controlled and
|
||||
by the specifications of the TLS/SSL protocol. Call SSL_get_error() with the
|
||||
return value B<ret> to find out the reason.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been
|
||||
established.
|
||||
|
||||
@@ -8,11 +8,11 @@ SSL_get_peer_cert_chain - get the X509 certificate chain of the peer
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
STACKOF(X509) *SSL_get_peer_cert_chain(const SSL *ssl);
|
||||
STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SSL_get_peer_cert_chain() returns a pointer to STACKOF(X509) certificates
|
||||
SSL_get_peer_cert_chain() returns a pointer to STACK_OF(X509) certificates
|
||||
forming the certificate chain of the peer. If called on the client side,
|
||||
the stack also contains the peer's certificate; if called on the server
|
||||
side, the peer's certificate must be obtained separately using
|
||||
@@ -24,7 +24,7 @@ If the peer did not present a certificate, NULL is returned.
|
||||
The peer certificate chain is not necessarily available after reusing
|
||||
a session, in which case a NULL pointer is returned.
|
||||
|
||||
The reference count of the STACKOF(X509) object is not incremented.
|
||||
The reference count of the STACK_OF(X509) object is not incremented.
|
||||
If the corresponding session is freed, the pointer must not be used
|
||||
any longer.
|
||||
|
||||
@@ -39,7 +39,7 @@ The following return values can occur:
|
||||
No certificate was presented by the peer or no connection was established
|
||||
or the certificate chain is no longer available when a session is reused.
|
||||
|
||||
=item Pointer to a STACKOF(X509)
|
||||
=item Pointer to a STACK_OF(X509)
|
||||
|
||||
The return value points to the certificate chain presented by the peer.
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ The following return values can occur:
|
||||
The read operation was successful; the return value is the number of
|
||||
bytes actually read from the TLS/SSL connection.
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The read operation was not successful. The reason may either be a clean
|
||||
shutdown due to a "close notify" alert sent by the peer (in which case
|
||||
|
||||
@@ -27,11 +27,11 @@ The following return values can occur:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
A new session was negotiated.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
A session was reused.
|
||||
|
||||
|
||||
@@ -35,11 +35,11 @@ The following return values can occur:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The operation failed. Check the error stack to find out why.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The operation succeeded.
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ The following return values can occur:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The operation failed; check the error stack to find out the reason.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The operation succeeded.
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ The shutdown state of an ssl connection is a bitmask of:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
No shutdown setting, yet.
|
||||
|
||||
|
||||
@@ -92,14 +92,14 @@ The following return values can occur:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0
|
||||
=item Z<>0
|
||||
|
||||
The shutdown is not yet finished. Call SSL_shutdown() for a second time,
|
||||
if a bidirectional shutdown shall be performed.
|
||||
The output of L<SSL_get_error(3)|SSL_get_error(3)> may be misleading, as an
|
||||
erroneous SSL_ERROR_SYSCALL may be flagged even though no error occurred.
|
||||
|
||||
=item 1
|
||||
=item Z<>1
|
||||
|
||||
The shutdown was successfully completed. The "close notify" alert was sent
|
||||
and the peer's "close notify" alert was received.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user