Skip to content

Commit

Permalink
Merge OpenSSL 1.0.1g.
Browse files Browse the repository at this point in the history
Approved by:	benl (maintainer)
  • Loading branch information
juikim committed Apr 8, 2014
1 parent 808e531 commit 89b378c
Show file tree
Hide file tree
Showing 388 changed files with 687 additions and 437 deletions.
29 changes: 29 additions & 0 deletions crypto/openssl/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@
OpenSSL CHANGES
_______________

Changes between 1.0.1f and 1.0.1g [7 Apr 2014]

*) A missing bounds check in the handling of the TLS heartbeat extension
can be used to reveal up to 64k of memory to a connected client or
server.

Thanks for Neel Mehta of Google Security for discovering this bug and to
Adam Langley <agl@chromium.org> and Bodo Moeller <bmoeller@acm.org> for
preparing the fix (CVE-2014-0160)
[Adam Langley, Bodo Moeller]

*) 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]

*) TLS pad extension: draft-agl-tls-padding-03

Workaround for the "TLS hang bug" (see FAQ and PR#2771): if the
TLS client Hello record length value would otherwise be > 255 and
less that 512 pad with a dummy extension containing zeroes so it
is at least 512 bytes long.

[Adam Langley, Steve Henson]

Changes between 1.0.1e and 1.0.1f [6 Jan 2014]

*) Fix for TLS record tampering bug. A carefully crafted invalid
Expand Down
2 changes: 1 addition & 1 deletion crypto/openssl/Configure
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ my %table=(
# 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE'
"VC-WIN32","cl:-W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
# Unified CE target
"debug-VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
"debug-VC-WIN32","cl:-W3 -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
"VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32",

# Borland C++ 4.5
Expand Down
3 changes: 3 additions & 0 deletions crypto/openssl/FAQ
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
6 changes: 3 additions & 3 deletions crypto/openssl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Makefile for OpenSSL
##

VERSION=1.0.1f
VERSION=1.0.1g
MAJOR=1
MINOR=0.1
SHLIB_VERSION_NUMBER=1.0.0
Expand Down Expand Up @@ -304,8 +304,8 @@ libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT)
FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \
export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \
fi; \
$(MAKE) -e SHLIBDIRS=crypto CC=$${CC:-$(CC)} build-shared; \
touch -c fips_premain_dso$(EXE_EXT); \
$(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared && \
(touch -c fips_premain_dso$(EXE_EXT) || :); \
else \
echo "There's no support for shared libraries on this platform" >&2; \
exit 1; \
Expand Down
4 changes: 2 additions & 2 deletions crypto/openssl/Makefile.org
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT)
FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \
export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \
fi; \
$(MAKE) -e SHLIBDIRS=crypto CC=$${CC:-$(CC)} build-shared; \
touch -c fips_premain_dso$(EXE_EXT); \
$(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared && \
(touch -c fips_premain_dso$(EXE_EXT) || :); \
else \
echo "There's no support for shared libraries on this platform" >&2; \
exit 1; \
Expand Down
7 changes: 7 additions & 0 deletions crypto/openssl/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +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.1f and OpenSSL 1.0.1g [7 Apr 2014]

o Fix for CVE-2014-0160
o Add TLS padding extension workaround for broken servers.
o Fix for CVE-2014-0076

Major changes between OpenSSL 1.0.1e and OpenSSL 1.0.1f [6 Jan 2014]

o Don't include gmt_unix_time in TLS server and client random values
o Fix for TLS record tampering bug CVE-2013-4353
o Fix for TLS version checking bug CVE-2013-6449
o Fix for DTLS retransmission bug CVE-2013-6450
Expand Down
2 changes: 1 addition & 1 deletion crypto/openssl/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

OpenSSL 1.0.1f 6 Jan 2014
OpenSSL 1.0.1g 7 Apr 2014

Copyright (c) 1998-2011 The OpenSSL Project
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
Expand Down
6 changes: 3 additions & 3 deletions crypto/openssl/apps/apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2841,7 +2841,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;
Expand Down
18 changes: 18 additions & 0 deletions crypto/openssl/apps/crl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -304,6 +314,14 @@ int MAIN(int argc, char **argv)
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=");
Expand Down
4 changes: 2 additions & 2 deletions crypto/openssl/apps/dgst.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,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");
Expand Down
4 changes: 2 additions & 2 deletions crypto/openssl/apps/ecparam.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -286,7 +286,7 @@ int MAIN(int argc, char **argv)
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");
Expand Down
13 changes: 7 additions & 6 deletions crypto/openssl/apps/req.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,11 @@ int MAIN(int argc, char **argv)
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,
Expand All @@ -652,12 +657,6 @@ int MAIN(int argc, char **argv)
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");
Expand Down Expand Up @@ -1649,6 +1648,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;
Expand Down
2 changes: 1 addition & 1 deletion crypto/openssl/crypto/aes/asm/vpaes-x86_64.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@
.Lk_dsbo: # decryption sbox final output
.quad 0x1387EA537EF94000, 0xC7AA6DB9D4943E2D
.quad 0x12D7560F93441D00, 0xCA4B8159D8C58E9C
.asciz "Vector Permutaion AES for x86_64/SSSE3, Mike Hamburg (Stanford University)"
.asciz "Vector Permutation AES for x86_64/SSSE3, Mike Hamburg (Stanford University)"
.align 64
.size _vpaes_consts,.-_vpaes_consts
___
Expand Down
2 changes: 1 addition & 1 deletion crypto/openssl/crypto/asn1/asn1_err.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,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"},
Expand Down
2 changes: 1 addition & 1 deletion crypto/openssl/crypto/bio/bss_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions crypto/openssl/crypto/cms/cms_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,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++)
Expand Down
2 changes: 1 addition & 1 deletion crypto/openssl/crypto/cryptlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,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);
Expand Down
1 change: 1 addition & 0 deletions crypto/openssl/crypto/engine/eng_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion crypto/openssl/crypto/evp/bio_b64.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,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. */
Expand Down
Loading

0 comments on commit 89b378c

Please sign in to comment.