Compare commits
165 Commits
OpenSSL_1_
...
OpenSSL_1_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9c7baca820 | ||
![]() |
618265e645 | ||
![]() |
9728978b75 | ||
![]() |
938c0bbae1 | ||
![]() |
a0cd818831 | ||
![]() |
31c4ab5401 | ||
![]() |
1f65529824 | ||
![]() |
5b3a6eedd1 | ||
![]() |
6938440d68 | ||
![]() |
57ec6c9bad | ||
![]() |
7a09bc4068 | ||
![]() |
deb15645a8 | ||
![]() |
f0b358e8b9 | ||
![]() |
dce2b5a8fc | ||
![]() |
59d100d959 | ||
![]() |
d497b5362b | ||
![]() |
369b0abdc2 | ||
![]() |
72240ab31a | ||
![]() |
dc4e1ddc9f | ||
![]() |
ff656346fa | ||
![]() |
ca91057d50 | ||
![]() |
8c1e7de6cb | ||
![]() |
207886cd3a | ||
![]() |
336d1ee733 | ||
![]() |
bed2b769f5 | ||
![]() |
26029d9c4c | ||
![]() |
c64c888929 | ||
![]() |
8d9db41880 | ||
![]() |
4fae54a8e0 | ||
![]() |
9f35928719 | ||
![]() |
c5af032df5 | ||
![]() |
8a898a6fcc | ||
![]() |
9f827ded1c | ||
![]() |
5daa9411a0 | ||
![]() |
094d4019b8 | ||
![]() |
1507f3abba | ||
![]() |
30e8defe52 | ||
![]() |
9f4dd3e3e3 | ||
![]() |
8c00014d7e | ||
![]() |
1cf12a6350 | ||
![]() |
dc9461e23f | ||
![]() |
72d57050df | ||
![]() |
49d1f665a4 | ||
![]() |
2c25edc4c1 | ||
![]() |
d2f098b33d | ||
![]() |
6f4f7f35f3 | ||
![]() |
0a4fe6c8db | ||
![]() |
7bba401d5d | ||
![]() |
c73cff12f1 | ||
![]() |
b32d93840e | ||
![]() |
cb457849fd | ||
![]() |
cb3c30059a | ||
![]() |
20dc93e49e | ||
![]() |
b620447dcc | ||
![]() |
4ffd2ad1d3 | ||
![]() |
acc9938ba5 | ||
![]() |
f6d13ac8cf | ||
![]() |
24cb653c6b | ||
![]() |
6dfd3cf68e | ||
![]() |
073775cbbb | ||
![]() |
e995d5044e | ||
![]() |
5b0a79a27a | ||
![]() |
6747de655e | ||
![]() |
91bad2b09e | ||
![]() |
1244d5b713 | ||
![]() |
c0ed5cd47b | ||
![]() |
c8281fd38e | ||
![]() |
fe8e6bff9b | ||
![]() |
9caf25d144 | ||
![]() |
348620c7ac | ||
![]() |
30fc2ab92b | ||
![]() |
5b5464d525 | ||
![]() |
cd15a0528f | ||
![]() |
7b52778eff | ||
![]() |
162de2f2b5 | ||
![]() |
f6e4af6fd7 | ||
![]() |
32b76dcdac | ||
![]() |
bcfd252052 | ||
![]() |
32c452779e | ||
![]() |
118b90c59e | ||
![]() |
f6a61b140e | ||
![]() |
75ece4b5cf | ||
![]() |
724cca4178 | ||
![]() |
5b3fdb0181 | ||
![]() |
fcc3d0265d | ||
![]() |
5356ea7cde | ||
![]() |
06226df1a9 | ||
![]() |
bf638ef026 | ||
![]() |
07973d5db8 | ||
![]() |
3b3f71121b | ||
![]() |
47333a34d5 | ||
![]() |
d92138f703 | ||
![]() |
b2bf335327 | ||
![]() |
33bec62a20 | ||
![]() |
2e630b1847 | ||
![]() |
002d3fe863 | ||
![]() |
fb24311e7c | ||
![]() |
90278430d9 | ||
![]() |
bcd9d12a8d | ||
![]() |
79363339b7 | ||
![]() |
fbe2c6b33e | ||
![]() |
fc11f47229 | ||
![]() |
2b23d89d14 | ||
![]() |
9cfa3cff54 | ||
![]() |
6507653e72 | ||
![]() |
7fe747d1eb | ||
![]() |
32567c9f3b | ||
![]() |
4f3d52fedc | ||
![]() |
8321bab39c | ||
![]() |
989238802a | ||
![]() |
9051fc538f | ||
![]() |
03fd7f27db | ||
![]() |
45d6a15ae9 | ||
![]() |
6c6ca18664 | ||
![]() |
97fe2b40c1 | ||
![]() |
f689ab5017 | ||
![]() |
edb7cac271 | ||
![]() |
81d87a2a28 | ||
![]() |
7366f0b304 | ||
![]() |
1d8fa09c80 | ||
![]() |
e085e6c84c | ||
![]() |
008fa4584d | ||
![]() |
c8c49133d9 | ||
![]() |
961f1dea06 | ||
![]() |
1700426256 | ||
![]() |
aa7f5baad2 | ||
![]() |
45acdd6f6d | ||
![]() |
8b354e776b | ||
![]() |
868f5e44ca | ||
![]() |
4e5fdd11ea | ||
![]() |
d552a3391a | ||
![]() |
d023b4e2dd | ||
![]() |
fa79cc9c23 | ||
![]() |
06daa75fb9 | ||
![]() |
ffa304c838 | ||
![]() |
df21765a3e | ||
![]() |
5a6ae115f8 | ||
![]() |
5e5df40b9b | ||
![]() |
6d4943e81f | ||
![]() |
57cffe901f | ||
![]() |
a758f61793 | ||
![]() |
b3b35df2a2 | ||
![]() |
5ad50246fc | ||
![]() |
d89b895cfd | ||
![]() |
d793c292cb | ||
![]() |
57749b1b9f | ||
![]() |
1cdb7854a5 | ||
![]() |
704d33b347 | ||
![]() |
b2a7515ee8 | ||
![]() |
f4f2b52995 | ||
![]() |
c7d5edbf5e | ||
![]() |
d8f07f1674 | ||
![]() |
78bfb45b07 | ||
![]() |
6ad4d60555 | ||
![]() |
2fad8aa209 | ||
![]() |
74397d45b2 | ||
![]() |
c8ca769d3b | ||
![]() |
25d42c17e3 | ||
![]() |
a377811f15 | ||
![]() |
ef1b6b2cf2 | ||
![]() |
1699389a46 | ||
![]() |
ad8ee3d7d1 | ||
![]() |
39f0a4d8e9 | ||
![]() |
15a9821cc2 | ||
![]() |
53e97e7433 |
93
CHANGES
93
CHANGES
@@ -2,12 +2,26 @@
|
||||
OpenSSL CHANGES
|
||||
_______________
|
||||
|
||||
Changes between 0.9.8m (?) and 1.0.0 [xx XXX xxxx]
|
||||
Changes between 1.0.0 and 1.0.0a [01 Jun 2010]
|
||||
|
||||
*) Check return value of int_rsa_verify in pkey_rsa_verifyrecover
|
||||
(CVE-2010-1633)
|
||||
[Steve Henson, Peter-Michael Hager <hager@dortmund.net>]
|
||||
|
||||
Changes between 0.9.8n and 1.0.0 [29 Mar 2010]
|
||||
|
||||
*) Add "missing" function EVP_CIPHER_CTX_copy(). This copies a cipher
|
||||
context. The operation can be customised via the ctrl mechanism in
|
||||
case ENGINEs want to include additional functionality.
|
||||
[Steve Henson]
|
||||
|
||||
*) Tolerate yet another broken PKCS#8 key format: private key value negative.
|
||||
[Steve Henson]
|
||||
|
||||
*) Add new -subject_hash_old and -issuer_hash_old options to x509 utility to
|
||||
output hashes compatible with older versions of OpenSSL.
|
||||
[Willy Weisz <weisz@vcpc.univie.ac.at>]
|
||||
|
||||
|
||||
*) Fix compression algorithm handling: if resuming a session use the
|
||||
compression algorithm of the resumed session instead of determining
|
||||
it from client hello again. Don't allow server to change algorithm.
|
||||
@@ -834,8 +848,54 @@
|
||||
|
||||
*) Change 'Configure' script to enable Camellia by default.
|
||||
[NTT]
|
||||
|
||||
Changes between 0.9.8n and 0.9.8o [xx XXX xxxx]
|
||||
|
||||
Changes between 0.9.8l (?) and 0.9.8m (?) [xx XXX xxxx]
|
||||
*) Correct a typo in the CMS ASN1 module which can result in invalid memory
|
||||
access or freeing data twice (CVE-2010-0742)
|
||||
[Steve Henson, Ronald Moesbergen <intercommit@gmail.com>]
|
||||
|
||||
*) Add SHA2 algorithms to SSL_library_init(). SHA2 is becoming far more
|
||||
common in certificates and some applications which only call
|
||||
SSL_library_init and not OpenSSL_add_all_algorithms() will fail.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.8m and 0.9.8n [24 Mar 2010]
|
||||
|
||||
*) When rejecting SSL/TLS records due to an incorrect version number, never
|
||||
update s->server with a new major version number. As of
|
||||
- OpenSSL 0.9.8m if 'short' is a 16-bit type,
|
||||
- OpenSSL 0.9.8f if 'short' is longer than 16 bits,
|
||||
the previous behavior could result in a read attempt at NULL when
|
||||
receiving specific incorrect SSL/TLS records once record payload
|
||||
protection is active. (CVE-2010-####)
|
||||
[Bodo Moeller, Adam Langley]
|
||||
|
||||
*) Fix for CVE-2010-0433 where some kerberos enabled versions of OpenSSL
|
||||
could be crashed if the relevant tables were not present (e.g. chrooted).
|
||||
[Tomas Hoger <thoger@redhat.com>]
|
||||
|
||||
Changes between 0.9.8l and 0.9.8m [25 Feb 2010]
|
||||
|
||||
*) Always check bn_wexpend() return values for failure. (CVE-2009-3245)
|
||||
[Martin Olsson, Neel Mehta]
|
||||
|
||||
*) Fix X509_STORE locking: Every 'objs' access requires a lock (to
|
||||
accommodate for stack sorting, always a write lock!).
|
||||
[Bodo Moeller]
|
||||
|
||||
*) On some versions of WIN32 Heap32Next is very slow. This can cause
|
||||
excessive delays in the RAND_poll(): over a minute. As a workaround
|
||||
include a time check in the inner Heap32Next loop too.
|
||||
[Steve Henson]
|
||||
|
||||
*) The code that handled flushing of data in SSL/TLS originally used the
|
||||
BIO_CTRL_INFO ctrl to see if any data was pending first. This caused
|
||||
the problem outlined in PR#1949. The fix suggested there however can
|
||||
trigger problems with buggy BIO_CTRL_WPENDING (e.g. some versions
|
||||
of Apache). So instead simplify the code to flush unconditionally.
|
||||
This should be fine since flushing with no data to flush is a no op.
|
||||
[Steve Henson]
|
||||
|
||||
*) Handle TLS versions 2.0 and later properly and correctly use the
|
||||
highest version of TLS/SSL supported. Although TLS >= 2.0 is some way
|
||||
@@ -844,7 +904,7 @@
|
||||
|
||||
*) Modify compression code so it frees up structures without using the
|
||||
ex_data callbacks. This works around a problem where some applications
|
||||
call CRYPTO_free_all_ex_data() before application exit (e.g. when
|
||||
call CRYPTO_cleanup_all_ex_data() before application exit (e.g. when
|
||||
restarting) then use compression (e.g. SSL with compression) later.
|
||||
This results in significant per-connection memory leaks and
|
||||
has caused some security issues including CVE-2008-1678 and
|
||||
@@ -856,7 +916,7 @@
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Add option SSL_OP_LEGACY_SERVER_CONNECT which will allow clients to
|
||||
connect (but not renegotiate) with servers which do not support RI.
|
||||
connect and renegotiate with servers which do not support RI.
|
||||
Until RI is more widely deployed this option is enabled by default.
|
||||
[Steve Henson]
|
||||
|
||||
@@ -864,14 +924,14 @@
|
||||
[Steve Henson]
|
||||
|
||||
*) If client attempts to renegotiate and doesn't support RI respond with
|
||||
a no_renegotiation alert as required by draft-ietf-tls-renegotiation.
|
||||
Some renegotiating TLS clients will continue a connection gracefully
|
||||
when they receive the alert. Unfortunately OpenSSL mishandled
|
||||
this alert and would hang waiting for a server hello which it will never
|
||||
receive. Now we treat a received no_renegotiation alert as a fatal
|
||||
error. This is because applications requesting a renegotiation might well
|
||||
expect it to succeed and would have no code in place to handle the server
|
||||
denying it so the only safe thing to do is to terminate the connection.
|
||||
a no_renegotiation alert as required by RFC5746. Some renegotiating
|
||||
TLS clients will continue a connection gracefully when they receive
|
||||
the alert. Unfortunately OpenSSL mishandled this alert and would hang
|
||||
waiting for a server hello which it will never receive. Now we treat a
|
||||
received no_renegotiation alert as a fatal error. This is because
|
||||
applications requesting a renegotiation might well expect it to succeed
|
||||
and would have no code in place to handle the server denying it so the
|
||||
only safe thing to do is to terminate the connection.
|
||||
[Steve Henson]
|
||||
|
||||
*) Add ctrl macro SSL_get_secure_renegotiation_support() which returns 1 if
|
||||
@@ -883,10 +943,9 @@
|
||||
the updated NID creation version. This should correctly handle UTF8.
|
||||
[Steve Henson]
|
||||
|
||||
*) Implement draft-ietf-tls-renegotiation-03. Re-enable
|
||||
renegotiation but require the extension as needed. Unfortunately,
|
||||
SSL3_FLAGS_ALLOW_UNSAFE_LEGACY_RENEGOTIATION turns out to be a
|
||||
bad idea. It has been replaced by
|
||||
*) Implement RFC5746. Re-enable renegotiation but require the extension
|
||||
as needed. Unfortunately, SSL3_FLAGS_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
|
||||
turns out to be a bad idea. It has been replaced by
|
||||
SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION which can be set with
|
||||
SSL_CTX_set_options(). This is really not recommended unless you
|
||||
know what you are doing.
|
||||
|
10
Configure
10
Configure
@@ -503,7 +503,7 @@ my %table=(
|
||||
"BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32",
|
||||
|
||||
# MinGW
|
||||
"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall:::MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
|
||||
"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
|
||||
# As for OPENSSL_USE_APPLINK. Applink makes it possible to use .dll
|
||||
# compiled with one compiler with application compiled with another
|
||||
# compiler. It's possible to engage Applink support in mingw64 build,
|
||||
@@ -511,7 +511,7 @@ my %table=(
|
||||
# handling, one can't seriously consider its binaries for using with
|
||||
# non-mingw64 run-time environment. And as mingw64 is always consistent
|
||||
# with itself, Applink is never engaged and can as well be omitted.
|
||||
"mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE:::MINGW64:-lws2_32 -lgdi32 -lcrypt32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a",
|
||||
"mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE::-D_MT:MINGW64:-lws2_32 -lgdi32 -lcrypt32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a",
|
||||
|
||||
# UWIN
|
||||
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
|
||||
@@ -547,7 +547,7 @@ my %table=(
|
||||
|
||||
##### MacOS X (a.k.a. Rhapsody or Darwin) setup
|
||||
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::",
|
||||
"darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
@@ -1789,11 +1789,11 @@ EOF
|
||||
(system $make_command.$make_targets) == 0 or exit $?
|
||||
if $make_targets ne "";
|
||||
if ( $perl =~ m@^/@) {
|
||||
&dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
|
||||
&dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";', '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
|
||||
&dofile("apps/CA.pl",$perl,'^#!/', '#!%s');
|
||||
} else {
|
||||
# No path for Perl known ...
|
||||
&dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
|
||||
&dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";', '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
|
||||
&dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
|
||||
}
|
||||
if ($depflags ne $default_depflags && !$make_depend) {
|
||||
|
4
FAQ
4
FAQ
@@ -79,7 +79,7 @@ OpenSSL - Frequently Asked Questions
|
||||
* Which is the current version of OpenSSL?
|
||||
|
||||
The current version is available from <URL: http://www.openssl.org>.
|
||||
OpenSSL 0.9.8k was released on Mar 25th, 2009.
|
||||
OpenSSL 1.0.0a was released on Jun 1st, 2010.
|
||||
|
||||
In addition to the current stable release, you can also access daily
|
||||
snapshots of the OpenSSL development version at <URL:
|
||||
@@ -722,7 +722,7 @@ file.
|
||||
Multi-threaded applications must provide two callback functions to
|
||||
OpenSSL by calling CRYPTO_set_locking_callback() and
|
||||
CRYPTO_set_id_callback(), for all versions of OpenSSL up to and
|
||||
including 0.9.8[abc...]. As of version 0.9.9, CRYPTO_set_id_callback()
|
||||
including 0.9.8[abc...]. As of version 1.0.0, CRYPTO_set_id_callback()
|
||||
and associated APIs are deprecated by CRYPTO_THREADID_set_callback()
|
||||
and friends. This is described in the threads(3) manpage.
|
||||
|
||||
|
@@ -594,7 +594,7 @@ install_docs:
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man3 \
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man5 \
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man7
|
||||
@pod2man="`cd util; ./pod2mantest $(PERL)`"; \
|
||||
@pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \
|
||||
here="`pwd`"; \
|
||||
filecase=; \
|
||||
if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
|
||||
|
37
NEWS
37
NEWS
@@ -5,9 +5,13 @@
|
||||
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 0.9.8l and OpenSSL 1.0:
|
||||
Major changes between OpenSSL 1.0.0 and OpenSSL 1.0.0a:
|
||||
|
||||
o Fix for security issue CVE-2010-1633.
|
||||
o GOST MAC and CFB fixes.
|
||||
|
||||
Major changes between OpenSSL 0.9.8n and OpenSSL 1.0:
|
||||
|
||||
o Support for draft-ietf-tls-renegotiation-03.txt
|
||||
o RFC3280 path validation: sufficient to process PKITS tests.
|
||||
o Integrated support for PVK files and keyblobs.
|
||||
o Change default private key format to PKCS#8.
|
||||
@@ -29,6 +33,35 @@
|
||||
o Opaque PRF Input TLS extension support.
|
||||
o Updated time routines to avoid OS limitations.
|
||||
|
||||
Major changes between OpenSSL 0.9.8n and OpenSSL 0.9.8o:
|
||||
|
||||
o Fix for security issue CVE-2010-0742.
|
||||
o Various DTLS fixes.
|
||||
o Recognise SHA2 certificates if only SSL algorithms added.
|
||||
o Fix for no-rc4 compilation.
|
||||
o Chil ENGINE unload workaround.
|
||||
|
||||
Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n:
|
||||
|
||||
o CFB cipher definition fixes.
|
||||
o Fix security issues CVE-2010-0740 and CVE-2010-0433.
|
||||
|
||||
Major changes between OpenSSL 0.9.8l and OpenSSL 0.9.8m:
|
||||
|
||||
o Cipher definition fixes.
|
||||
o Workaround for slow RAND_poll() on some WIN32 versions.
|
||||
o Remove MD2 from algorithm tables.
|
||||
o SPKAC handling fixes.
|
||||
o Support for RFC5746 TLS renegotiation extension.
|
||||
o Compression memory leak fixed.
|
||||
o Compression session resumption fixed.
|
||||
o Ticket and SNI coexistence fixes.
|
||||
o Many fixes to DTLS handling.
|
||||
|
||||
Major changes between OpenSSL 0.9.8k and OpenSSL 0.9.8l:
|
||||
|
||||
o Temporary work around for CVE-2009-3555: disable renegotiation.
|
||||
|
||||
Major changes between OpenSSL 0.9.8j and OpenSSL 0.9.8k:
|
||||
|
||||
o Fix various build issues.
|
||||
|
4
README
4
README
@@ -1,7 +1,7 @@
|
||||
|
||||
OpenSSL 1.0.0-beta5 20 Jan 2010
|
||||
OpenSSL 1.0.0a 1 Jun 2010
|
||||
|
||||
Copyright (c) 1998-2009 The OpenSSL Project
|
||||
Copyright (c) 1998-2010 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
All rights reserved.
|
||||
|
||||
|
12
STATUS
12
STATUS
@@ -1,14 +1,14 @@
|
||||
|
||||
OpenSSL STATUS Last modified at
|
||||
______________ $Date: 2010/01/20 15:00:48 $
|
||||
______________ $Date: 2010/06/01 13:31:36 $
|
||||
|
||||
DEVELOPMENT STATE
|
||||
|
||||
o OpenSSL 1.0.0-beta5: Released on January 20th, 2010
|
||||
o OpenSSL 1.0.0-beta4: Released on November 10th, 2009
|
||||
o OpenSSL 1.0.0-beta3: Released on July 15th, 2009
|
||||
o OpenSSL 1.0.0-beta2: Released on April 21st, 2009
|
||||
o OpenSSL 1.0.0-beta1: Released on April 1st, 2009
|
||||
o OpenSSL 1.1.0: Under development...
|
||||
o OpenSSL 1.0.0a: Released on June 1st, 2010
|
||||
o OpenSSL 1.0.0: Released on March 29th, 2010
|
||||
o OpenSSL 0.9.8n: Released on March 24th, 2010
|
||||
o OpenSSL 0.9.8m: Released on February 25th, 2010
|
||||
o OpenSSL 0.9.8l: Released on November 5th, 2009
|
||||
o OpenSSL 0.9.8k: Released on March 25th, 2009
|
||||
o OpenSSL 0.9.8j: Released on January 7th, 2009
|
||||
|
6
TABLE
6
TABLE
@@ -1211,7 +1211,7 @@ $multilib =
|
||||
|
||||
*** darwin-ppc-cc
|
||||
$cc = cc
|
||||
$cflags = -arch ppc -O3 -DB_ENDIAN
|
||||
$cflags = -arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id = MACOSX
|
||||
@@ -3879,7 +3879,7 @@ $multilib = 64
|
||||
$cc = gcc
|
||||
$cflags = -mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall
|
||||
$unistd =
|
||||
$thread_cflag =
|
||||
$thread_cflag = -D_MT
|
||||
$sys_id = MINGW32
|
||||
$lflags = -lws2_32 -lgdi32 -lcrypt32
|
||||
$bn_ops = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT EXPORT_VAR_AS_FN
|
||||
@@ -3910,7 +3910,7 @@ $multilib =
|
||||
$cc = gcc
|
||||
$cflags = -mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE
|
||||
$unistd =
|
||||
$thread_cflag =
|
||||
$thread_cflag = -D_MT
|
||||
$sys_id = MINGW64
|
||||
$lflags = -lws2_32 -lgdi32 -lcrypt32
|
||||
$bn_ops = SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN
|
||||
|
@@ -114,8 +114,8 @@ $!
|
||||
$ IF F$SEARCH(CATOP+".private"+CAKEY) .EQS. ""
|
||||
$ THEN
|
||||
$ READ '__INPUT' FILE -
|
||||
/PROMT="CA certificate filename (or enter to create)"
|
||||
$ IF F$SEARCH(FILE) .NES. ""
|
||||
/PROMPT="CA certificate filename (or enter to create)"
|
||||
$ IF (FILE .NES. "") .AND. (F$SEARCH(FILE) .NES. "")
|
||||
$ THEN
|
||||
$ COPY 'FILE' 'CATOP'.private'CAKEY'
|
||||
$ RET=$STATUS
|
||||
|
16
apps/apps.c
16
apps/apps.c
@@ -875,10 +875,17 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
|
||||
if (format == FORMAT_ENGINE)
|
||||
{
|
||||
if (!e)
|
||||
BIO_printf(bio_err,"no engine specified\n");
|
||||
BIO_printf(err,"no engine specified\n");
|
||||
else
|
||||
{
|
||||
pkey = ENGINE_load_private_key(e, file,
|
||||
ui_method, &cb_data);
|
||||
if (!pkey)
|
||||
{
|
||||
BIO_printf(err,"cannot load %s from engine\n",key_descrip);
|
||||
ERR_print_errors(err);
|
||||
}
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
@@ -923,7 +930,7 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
|
||||
&pkey, NULL, NULL))
|
||||
goto end;
|
||||
}
|
||||
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
|
||||
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA) && !defined (OPENSSL_NO_RC4)
|
||||
else if (format == FORMAT_MSBLOB)
|
||||
pkey = b2i_PrivateKey_bio(key);
|
||||
else if (format == FORMAT_PVK)
|
||||
@@ -937,8 +944,11 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
|
||||
}
|
||||
end:
|
||||
if (key != NULL) BIO_free(key);
|
||||
if (pkey == NULL)
|
||||
if (pkey == NULL)
|
||||
{
|
||||
BIO_printf(err,"unable to load %s\n", key_descrip);
|
||||
ERR_print_errors(err);
|
||||
}
|
||||
return(pkey);
|
||||
}
|
||||
|
||||
|
@@ -155,7 +155,7 @@ int MAIN(int argc, char **argv)
|
||||
if ((*argv)[0] != '-') break;
|
||||
if (strcmp(*argv,"-c") == 0)
|
||||
separator=1;
|
||||
if (strcmp(*argv,"-r") == 0)
|
||||
else if (strcmp(*argv,"-r") == 0)
|
||||
separator=2;
|
||||
else if (strcmp(*argv,"-rand") == 0)
|
||||
{
|
||||
|
@@ -334,7 +334,7 @@ bad:
|
||||
i=PEM_write_bio_DSA_PUBKEY(out,dsa);
|
||||
else i=PEM_write_bio_DSAPrivateKey(out,dsa,enc,
|
||||
NULL,0,NULL, passout);
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_RC4)
|
||||
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
|
||||
EVP_PKEY *pk;
|
||||
pk = EVP_PKEY_new();
|
||||
|
@@ -265,8 +265,11 @@ bad:
|
||||
|
||||
BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
|
||||
num);
|
||||
|
||||
#ifdef OPENSSL_NO_ENGINE
|
||||
rsa = RSA_new();
|
||||
#else
|
||||
rsa = RSA_new_method(e);
|
||||
#endif
|
||||
if (!rsa)
|
||||
goto err;
|
||||
|
||||
|
@@ -25,7 +25,7 @@ $! VAXC For VAX C.
|
||||
$! DECC For DEC C.
|
||||
$! GNUC For GNU C.
|
||||
$!
|
||||
$! If you don't speficy a compiler, it will try to determine which
|
||||
$! If you don't specify a compiler, it will try to determine which
|
||||
$! "C" compiler to use.
|
||||
$!
|
||||
$! P3, if defined, sets a TCP/IP library to use, through one of the following
|
||||
@@ -52,7 +52,7 @@ $ THEN
|
||||
$!
|
||||
$! The Architecture Is VAX.
|
||||
$!
|
||||
$ ARCH := VAX
|
||||
$ ARCH = "VAX"
|
||||
$!
|
||||
$! Else...
|
||||
$!
|
||||
@@ -555,7 +555,7 @@ $! Time To EXIT.
|
||||
$!
|
||||
$ EXIT
|
||||
$!
|
||||
$! End The Valid Arguement Check.
|
||||
$! End The Valid Argument Check.
|
||||
$!
|
||||
$ ENDIF
|
||||
$!
|
||||
@@ -770,7 +770,7 @@ $! Set up default defines
|
||||
$!
|
||||
$ CCDEFS = """FLAT_INC=1""," + CCDEFS
|
||||
$!
|
||||
$! Else The User Entered An Invalid Arguement.
|
||||
$! Else The User Entered An Invalid Argument.
|
||||
$!
|
||||
$ ELSE
|
||||
$!
|
||||
@@ -875,7 +875,7 @@ $! Print info
|
||||
$!
|
||||
$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB
|
||||
$!
|
||||
$! Else The User Entered An Invalid Arguement.
|
||||
$! Else The User Entered An Invalid Argument.
|
||||
$!
|
||||
$ ELSE
|
||||
$!
|
||||
|
@@ -403,6 +403,10 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err, "DSA public key include in PrivateKey\n");
|
||||
break;
|
||||
|
||||
case PKCS8_NEG_PRIVKEY:
|
||||
BIO_printf(bio_err, "DSA private key value is negative\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
BIO_printf(bio_err, "Unknown broken type\n");
|
||||
break;
|
||||
|
@@ -1336,11 +1336,17 @@ start2: for (;;)
|
||||
|
||||
BIO_snprintf(buf,sizeof buf,"%s_min",type);
|
||||
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_min))
|
||||
{
|
||||
ERR_clear_error();
|
||||
n_min = -1;
|
||||
}
|
||||
|
||||
BIO_snprintf(buf,sizeof buf,"%s_max",type);
|
||||
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_max))
|
||||
{
|
||||
ERR_clear_error();
|
||||
n_max = -1;
|
||||
}
|
||||
|
||||
if (!add_attribute_object(req,
|
||||
v->value,def,value,nid,n_min,n_max, chtype))
|
||||
|
@@ -409,7 +409,7 @@ bad:
|
||||
}
|
||||
else i=PEM_write_bio_RSAPrivateKey(out,rsa,
|
||||
enc,NULL,0,NULL,passout);
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4)
|
||||
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
|
||||
EVP_PKEY *pk;
|
||||
pk = EVP_PKEY_new();
|
||||
|
20
apps/speed.c
20
apps/speed.c
@@ -184,12 +184,18 @@
|
||||
#include <openssl/ecdh.h>
|
||||
#endif
|
||||
|
||||
#if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE)
|
||||
# define NO_FORK 1
|
||||
#elif HAVE_FORK
|
||||
# undef NO_FORK
|
||||
#ifndef HAVE_FORK
|
||||
# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE)
|
||||
# define HAVE_FORK 0
|
||||
# else
|
||||
# define HAVE_FORK 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_FORK
|
||||
#undef NO_FORK
|
||||
#else
|
||||
# define NO_FORK 1
|
||||
#define NO_FORK
|
||||
#endif
|
||||
|
||||
#undef BUFSIZE
|
||||
@@ -226,8 +232,12 @@ static const char *names[ALGOR_NUM]={
|
||||
"aes-128 ige","aes-192 ige","aes-256 ige"};
|
||||
static double results[ALGOR_NUM][SIZE_NUM];
|
||||
static int lengths[SIZE_NUM]={16,64,256,1024,8*1024};
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
static double rsa_results[RSA_NUM][2];
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
static double dsa_results[DSA_NUM][2];
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
static double ecdsa_results[EC_NUM][2];
|
||||
#endif
|
||||
|
4
config
4
config
@@ -775,6 +775,10 @@ case "$GUESSOS" in
|
||||
OBJECT_MODE=${OBJECT_MODE:-32}
|
||||
if [ "$CC" = "gcc" ]; then
|
||||
OUT="aix-gcc"
|
||||
if [ $OBJECT_MODE -eq 64 ]; then
|
||||
echo 'Your $OBJECT_MODE was found to be set to 64'
|
||||
OUT="aix64-gcc"
|
||||
fi
|
||||
elif [ $OBJECT_MODE -eq 64 ]; then
|
||||
echo 'Your $OBJECT_MODE was found to be set to 64'
|
||||
OUT="aix64-cc"
|
||||
|
@@ -1024,6 +1024,7 @@ _armv4_AES_decrypt:
|
||||
mov pc,lr @ return
|
||||
.size _armv4_AES_decrypt,.-_armv4_AES_decrypt
|
||||
.asciz "AES for ARMv4, CRYPTOGAMS by <appro\@openssl.org>"
|
||||
.align 2
|
||||
___
|
||||
|
||||
$code =~ s/\bbx\s+lr\b/.word\t0xe12fff1e/gm; # make it possible to compile with -march=armv4
|
||||
|
@@ -16,6 +16,19 @@
|
||||
# at 1/2 of ppc_AES_encrypt speed, while ppc_AES_decrypt_compact -
|
||||
# at 1/3 of ppc_AES_decrypt.
|
||||
|
||||
# February 2010
|
||||
#
|
||||
# Rescheduling instructions to favour Power6 pipeline gives 10%
|
||||
# performance improvement on the platfrom in question (and marginal
|
||||
# improvement even on others). It should be noted that Power6 fails
|
||||
# to process byte in 18 cycles, only in 23, because it fails to issue
|
||||
# 4 load instructions in two cycles, only in 3. As result non-compact
|
||||
# block subroutines are 25% slower than one would expect. Compact
|
||||
# functions scale better, because they have pure computational part,
|
||||
# which scales perfectly with clock frequency. To be specific
|
||||
# ppc_AES_encrypt_compact operates at 42 cycles per byte, while
|
||||
# ppc_AES_decrypt_compact - at 55 (in 64-bit build).
|
||||
|
||||
$flavour = shift;
|
||||
|
||||
if ($flavour =~ /64/) {
|
||||
@@ -376,7 +389,7 @@ $code.=<<___;
|
||||
addi $sp,$sp,$FRAME
|
||||
blr
|
||||
|
||||
.align 4
|
||||
.align 5
|
||||
Lppc_AES_encrypt:
|
||||
lwz $acc00,240($key)
|
||||
lwz $t0,0($key)
|
||||
@@ -397,46 +410,46 @@ Lppc_AES_encrypt:
|
||||
Lenc_loop:
|
||||
rlwinm $acc00,$s0,`32-24+3`,21,28
|
||||
rlwinm $acc01,$s1,`32-24+3`,21,28
|
||||
lwz $t0,0($key)
|
||||
lwz $t1,4($key)
|
||||
rlwinm $acc02,$s2,`32-24+3`,21,28
|
||||
rlwinm $acc03,$s3,`32-24+3`,21,28
|
||||
lwz $t2,8($key)
|
||||
lwz $t3,12($key)
|
||||
lwz $t0,0($key)
|
||||
lwz $t1,4($key)
|
||||
rlwinm $acc04,$s1,`32-16+3`,21,28
|
||||
rlwinm $acc05,$s2,`32-16+3`,21,28
|
||||
lwzx $acc00,$Tbl0,$acc00
|
||||
lwzx $acc01,$Tbl0,$acc01
|
||||
lwz $t2,8($key)
|
||||
lwz $t3,12($key)
|
||||
rlwinm $acc06,$s3,`32-16+3`,21,28
|
||||
rlwinm $acc07,$s0,`32-16+3`,21,28
|
||||
lwzx $acc02,$Tbl0,$acc02
|
||||
lwzx $acc03,$Tbl0,$acc03
|
||||
lwzx $acc00,$Tbl0,$acc00
|
||||
lwzx $acc01,$Tbl0,$acc01
|
||||
rlwinm $acc08,$s2,`32-8+3`,21,28
|
||||
rlwinm $acc09,$s3,`32-8+3`,21,28
|
||||
lwzx $acc04,$Tbl1,$acc04
|
||||
lwzx $acc05,$Tbl1,$acc05
|
||||
lwzx $acc02,$Tbl0,$acc02
|
||||
lwzx $acc03,$Tbl0,$acc03
|
||||
rlwinm $acc10,$s0,`32-8+3`,21,28
|
||||
rlwinm $acc11,$s1,`32-8+3`,21,28
|
||||
lwzx $acc06,$Tbl1,$acc06
|
||||
lwzx $acc07,$Tbl1,$acc07
|
||||
lwzx $acc04,$Tbl1,$acc04
|
||||
lwzx $acc05,$Tbl1,$acc05
|
||||
rlwinm $acc12,$s3,`0+3`,21,28
|
||||
rlwinm $acc13,$s0,`0+3`,21,28
|
||||
lwzx $acc08,$Tbl2,$acc08
|
||||
lwzx $acc09,$Tbl2,$acc09
|
||||
lwzx $acc06,$Tbl1,$acc06
|
||||
lwzx $acc07,$Tbl1,$acc07
|
||||
rlwinm $acc14,$s1,`0+3`,21,28
|
||||
rlwinm $acc15,$s2,`0+3`,21,28
|
||||
lwzx $acc10,$Tbl2,$acc10
|
||||
lwzx $acc11,$Tbl2,$acc11
|
||||
lwzx $acc08,$Tbl2,$acc08
|
||||
lwzx $acc09,$Tbl2,$acc09
|
||||
xor $t0,$t0,$acc00
|
||||
xor $t1,$t1,$acc01
|
||||
lwzx $acc12,$Tbl3,$acc12
|
||||
lwzx $acc13,$Tbl3,$acc13
|
||||
lwzx $acc10,$Tbl2,$acc10
|
||||
lwzx $acc11,$Tbl2,$acc11
|
||||
xor $t2,$t2,$acc02
|
||||
xor $t3,$t3,$acc03
|
||||
lwzx $acc14,$Tbl3,$acc14
|
||||
lwzx $acc15,$Tbl3,$acc15
|
||||
lwzx $acc12,$Tbl3,$acc12
|
||||
lwzx $acc13,$Tbl3,$acc13
|
||||
xor $t0,$t0,$acc04
|
||||
xor $t1,$t1,$acc05
|
||||
lwzx $acc14,$Tbl3,$acc14
|
||||
lwzx $acc15,$Tbl3,$acc15
|
||||
xor $t2,$t2,$acc06
|
||||
xor $t3,$t3,$acc07
|
||||
xor $t0,$t0,$acc08
|
||||
@@ -452,60 +465,60 @@ Lenc_loop:
|
||||
|
||||
addi $Tbl2,$Tbl0,2048
|
||||
nop
|
||||
lwz $acc08,`2048+0`($Tbl0) ! prefetch Te4
|
||||
lwz $acc09,`2048+32`($Tbl0)
|
||||
lwz $acc10,`2048+64`($Tbl0)
|
||||
lwz $acc11,`2048+96`($Tbl0)
|
||||
lwz $acc08,`2048+128`($Tbl0)
|
||||
lwz $acc09,`2048+160`($Tbl0)
|
||||
lwz $acc10,`2048+192`($Tbl0)
|
||||
lwz $acc11,`2048+224`($Tbl0)
|
||||
rlwinm $acc00,$s0,`32-24`,24,31
|
||||
rlwinm $acc01,$s1,`32-24`,24,31
|
||||
lwz $t0,0($key)
|
||||
lwz $t1,4($key)
|
||||
rlwinm $acc02,$s2,`32-24`,24,31
|
||||
rlwinm $acc03,$s3,`32-24`,24,31
|
||||
rlwinm $acc00,$s0,`32-24`,24,31
|
||||
rlwinm $acc01,$s1,`32-24`,24,31
|
||||
lwz $t2,8($key)
|
||||
lwz $t3,12($key)
|
||||
rlwinm $acc02,$s2,`32-24`,24,31
|
||||
rlwinm $acc03,$s3,`32-24`,24,31
|
||||
lwz $acc08,`2048+0`($Tbl0) ! prefetch Te4
|
||||
lwz $acc09,`2048+32`($Tbl0)
|
||||
rlwinm $acc04,$s1,`32-16`,24,31
|
||||
rlwinm $acc05,$s2,`32-16`,24,31
|
||||
lbzx $acc00,$Tbl2,$acc00
|
||||
lbzx $acc01,$Tbl2,$acc01
|
||||
lwz $acc10,`2048+64`($Tbl0)
|
||||
lwz $acc11,`2048+96`($Tbl0)
|
||||
rlwinm $acc06,$s3,`32-16`,24,31
|
||||
rlwinm $acc07,$s0,`32-16`,24,31
|
||||
lbzx $acc02,$Tbl2,$acc02
|
||||
lbzx $acc03,$Tbl2,$acc03
|
||||
lwz $acc12,`2048+128`($Tbl0)
|
||||
lwz $acc13,`2048+160`($Tbl0)
|
||||
rlwinm $acc08,$s2,`32-8`,24,31
|
||||
rlwinm $acc09,$s3,`32-8`,24,31
|
||||
lbzx $acc04,$Tbl2,$acc04
|
||||
lbzx $acc05,$Tbl2,$acc05
|
||||
lwz $acc14,`2048+192`($Tbl0)
|
||||
lwz $acc15,`2048+224`($Tbl0)
|
||||
rlwinm $acc10,$s0,`32-8`,24,31
|
||||
rlwinm $acc11,$s1,`32-8`,24,31
|
||||
lbzx $acc06,$Tbl2,$acc06
|
||||
lbzx $acc07,$Tbl2,$acc07
|
||||
lbzx $acc00,$Tbl2,$acc00
|
||||
lbzx $acc01,$Tbl2,$acc01
|
||||
rlwinm $acc12,$s3,`0`,24,31
|
||||
rlwinm $acc13,$s0,`0`,24,31
|
||||
lbzx $acc08,$Tbl2,$acc08
|
||||
lbzx $acc09,$Tbl2,$acc09
|
||||
lbzx $acc02,$Tbl2,$acc02
|
||||
lbzx $acc03,$Tbl2,$acc03
|
||||
rlwinm $acc14,$s1,`0`,24,31
|
||||
rlwinm $acc15,$s2,`0`,24,31
|
||||
lbzx $acc10,$Tbl2,$acc10
|
||||
lbzx $acc11,$Tbl2,$acc11
|
||||
lbzx $acc04,$Tbl2,$acc04
|
||||
lbzx $acc05,$Tbl2,$acc05
|
||||
rlwinm $s0,$acc00,24,0,7
|
||||
rlwinm $s1,$acc01,24,0,7
|
||||
lbzx $acc12,$Tbl2,$acc12
|
||||
lbzx $acc13,$Tbl2,$acc13
|
||||
lbzx $acc06,$Tbl2,$acc06
|
||||
lbzx $acc07,$Tbl2,$acc07
|
||||
rlwinm $s2,$acc02,24,0,7
|
||||
rlwinm $s3,$acc03,24,0,7
|
||||
lbzx $acc14,$Tbl2,$acc14
|
||||
lbzx $acc15,$Tbl2,$acc15
|
||||
lbzx $acc08,$Tbl2,$acc08
|
||||
lbzx $acc09,$Tbl2,$acc09
|
||||
rlwimi $s0,$acc04,16,8,15
|
||||
rlwimi $s1,$acc05,16,8,15
|
||||
lbzx $acc10,$Tbl2,$acc10
|
||||
lbzx $acc11,$Tbl2,$acc11
|
||||
rlwimi $s2,$acc06,16,8,15
|
||||
rlwimi $s3,$acc07,16,8,15
|
||||
lbzx $acc12,$Tbl2,$acc12
|
||||
lbzx $acc13,$Tbl2,$acc13
|
||||
rlwimi $s0,$acc08,8,16,23
|
||||
rlwimi $s1,$acc09,8,16,23
|
||||
lbzx $acc14,$Tbl2,$acc14
|
||||
lbzx $acc15,$Tbl2,$acc15
|
||||
rlwimi $s2,$acc10,8,16,23
|
||||
rlwimi $s3,$acc11,8,16,23
|
||||
or $s0,$s0,$acc12
|
||||
@@ -542,40 +555,40 @@ Lenc_compact_loop:
|
||||
rlwinm $acc01,$s1,`32-24`,24,31
|
||||
rlwinm $acc02,$s2,`32-24`,24,31
|
||||
rlwinm $acc03,$s3,`32-24`,24,31
|
||||
lbzx $acc00,$Tbl1,$acc00
|
||||
lbzx $acc01,$Tbl1,$acc01
|
||||
rlwinm $acc04,$s1,`32-16`,24,31
|
||||
rlwinm $acc05,$s2,`32-16`,24,31
|
||||
lbzx $acc02,$Tbl1,$acc02
|
||||
lbzx $acc03,$Tbl1,$acc03
|
||||
rlwinm $acc06,$s3,`32-16`,24,31
|
||||
rlwinm $acc07,$s0,`32-16`,24,31
|
||||
lbzx $acc04,$Tbl1,$acc04
|
||||
lbzx $acc05,$Tbl1,$acc05
|
||||
lbzx $acc00,$Tbl1,$acc00
|
||||
lbzx $acc01,$Tbl1,$acc01
|
||||
rlwinm $acc08,$s2,`32-8`,24,31
|
||||
rlwinm $acc09,$s3,`32-8`,24,31
|
||||
lbzx $acc06,$Tbl1,$acc06
|
||||
lbzx $acc07,$Tbl1,$acc07
|
||||
lbzx $acc02,$Tbl1,$acc02
|
||||
lbzx $acc03,$Tbl1,$acc03
|
||||
rlwinm $acc10,$s0,`32-8`,24,31
|
||||
rlwinm $acc11,$s1,`32-8`,24,31
|
||||
lbzx $acc08,$Tbl1,$acc08
|
||||
lbzx $acc09,$Tbl1,$acc09
|
||||
lbzx $acc04,$Tbl1,$acc04
|
||||
lbzx $acc05,$Tbl1,$acc05
|
||||
rlwinm $acc12,$s3,`0`,24,31
|
||||
rlwinm $acc13,$s0,`0`,24,31
|
||||
lbzx $acc10,$Tbl1,$acc10
|
||||
lbzx $acc11,$Tbl1,$acc11
|
||||
lbzx $acc06,$Tbl1,$acc06
|
||||
lbzx $acc07,$Tbl1,$acc07
|
||||
rlwinm $acc14,$s1,`0`,24,31
|
||||
rlwinm $acc15,$s2,`0`,24,31
|
||||
lbzx $acc12,$Tbl1,$acc12
|
||||
lbzx $acc13,$Tbl1,$acc13
|
||||
lbzx $acc08,$Tbl1,$acc08
|
||||
lbzx $acc09,$Tbl1,$acc09
|
||||
rlwinm $s0,$acc00,24,0,7
|
||||
rlwinm $s1,$acc01,24,0,7
|
||||
lbzx $acc14,$Tbl1,$acc14
|
||||
lbzx $acc15,$Tbl1,$acc15
|
||||
lbzx $acc10,$Tbl1,$acc10
|
||||
lbzx $acc11,$Tbl1,$acc11
|
||||
rlwinm $s2,$acc02,24,0,7
|
||||
rlwinm $s3,$acc03,24,0,7
|
||||
lbzx $acc12,$Tbl1,$acc12
|
||||
lbzx $acc13,$Tbl1,$acc13
|
||||
rlwimi $s0,$acc04,16,8,15
|
||||
rlwimi $s1,$acc05,16,8,15
|
||||
lbzx $acc14,$Tbl1,$acc14
|
||||
lbzx $acc15,$Tbl1,$acc15
|
||||
rlwimi $s2,$acc06,16,8,15
|
||||
rlwimi $s3,$acc07,16,8,15
|
||||
rlwimi $s0,$acc08,8,16,23
|
||||
@@ -725,7 +738,7 @@ Lenc_compact_done:
|
||||
addi $sp,$sp,$FRAME
|
||||
blr
|
||||
|
||||
.align 4
|
||||
.align 5
|
||||
Lppc_AES_decrypt:
|
||||
lwz $acc00,240($key)
|
||||
lwz $t0,0($key)
|
||||
@@ -746,46 +759,46 @@ Lppc_AES_decrypt:
|
||||
Ldec_loop:
|
||||
rlwinm $acc00,$s0,`32-24+3`,21,28
|
||||
rlwinm $acc01,$s1,`32-24+3`,21,28
|
||||
lwz $t0,0($key)
|
||||
lwz $t1,4($key)
|
||||
rlwinm $acc02,$s2,`32-24+3`,21,28
|
||||
rlwinm $acc03,$s3,`32-24+3`,21,28
|
||||
lwz $t2,8($key)
|
||||
lwz $t3,12($key)
|
||||
lwz $t0,0($key)
|
||||
lwz $t1,4($key)
|
||||
rlwinm $acc04,$s3,`32-16+3`,21,28
|
||||
rlwinm $acc05,$s0,`32-16+3`,21,28
|
||||
lwzx $acc00,$Tbl0,$acc00
|
||||
lwzx $acc01,$Tbl0,$acc01
|
||||
lwz $t2,8($key)
|
||||
lwz $t3,12($key)
|
||||
rlwinm $acc06,$s1,`32-16+3`,21,28
|
||||
rlwinm $acc07,$s2,`32-16+3`,21,28
|
||||
lwzx $acc02,$Tbl0,$acc02
|
||||
lwzx $acc03,$Tbl0,$acc03
|
||||
lwzx $acc00,$Tbl0,$acc00
|
||||
lwzx $acc01,$Tbl0,$acc01
|
||||
rlwinm $acc08,$s2,`32-8+3`,21,28
|
||||
rlwinm $acc09,$s3,`32-8+3`,21,28
|
||||
lwzx $acc04,$Tbl1,$acc04
|
||||
lwzx $acc05,$Tbl1,$acc05
|
||||
lwzx $acc02,$Tbl0,$acc02
|
||||
lwzx $acc03,$Tbl0,$acc03
|
||||
rlwinm $acc10,$s0,`32-8+3`,21,28
|
||||
rlwinm $acc11,$s1,`32-8+3`,21,28
|
||||
lwzx $acc06,$Tbl1,$acc06
|
||||
lwzx $acc07,$Tbl1,$acc07
|
||||
lwzx $acc04,$Tbl1,$acc04
|
||||
lwzx $acc05,$Tbl1,$acc05
|
||||
rlwinm $acc12,$s1,`0+3`,21,28
|
||||
rlwinm $acc13,$s2,`0+3`,21,28
|
||||
lwzx $acc08,$Tbl2,$acc08
|
||||
lwzx $acc09,$Tbl2,$acc09
|
||||
lwzx $acc06,$Tbl1,$acc06
|
||||
lwzx $acc07,$Tbl1,$acc07
|
||||
rlwinm $acc14,$s3,`0+3`,21,28
|
||||
rlwinm $acc15,$s0,`0+3`,21,28
|
||||
lwzx $acc10,$Tbl2,$acc10
|
||||
lwzx $acc11,$Tbl2,$acc11
|
||||
lwzx $acc08,$Tbl2,$acc08
|
||||
lwzx $acc09,$Tbl2,$acc09
|
||||
xor $t0,$t0,$acc00
|
||||
xor $t1,$t1,$acc01
|
||||
lwzx $acc12,$Tbl3,$acc12
|
||||
lwzx $acc13,$Tbl3,$acc13
|
||||
lwzx $acc10,$Tbl2,$acc10
|
||||
lwzx $acc11,$Tbl2,$acc11
|
||||
xor $t2,$t2,$acc02
|
||||
xor $t3,$t3,$acc03
|
||||
lwzx $acc14,$Tbl3,$acc14
|
||||
lwzx $acc15,$Tbl3,$acc15
|
||||
lwzx $acc12,$Tbl3,$acc12
|
||||
lwzx $acc13,$Tbl3,$acc13
|
||||
xor $t0,$t0,$acc04
|
||||
xor $t1,$t1,$acc05
|
||||
lwzx $acc14,$Tbl3,$acc14
|
||||
lwzx $acc15,$Tbl3,$acc15
|
||||
xor $t2,$t2,$acc06
|
||||
xor $t3,$t3,$acc07
|
||||
xor $t0,$t0,$acc08
|
||||
@@ -801,56 +814,56 @@ Ldec_loop:
|
||||
|
||||
addi $Tbl2,$Tbl0,2048
|
||||
nop
|
||||
lwz $acc08,`2048+0`($Tbl0) ! prefetch Td4
|
||||
lwz $acc09,`2048+32`($Tbl0)
|
||||
lwz $acc10,`2048+64`($Tbl0)
|
||||
lwz $acc11,`2048+96`($Tbl0)
|
||||
lwz $acc08,`2048+128`($Tbl0)
|
||||
lwz $acc09,`2048+160`($Tbl0)
|
||||
lwz $acc10,`2048+192`($Tbl0)
|
||||
lwz $acc11,`2048+224`($Tbl0)
|
||||
rlwinm $acc00,$s0,`32-24`,24,31
|
||||
rlwinm $acc01,$s1,`32-24`,24,31
|
||||
lwz $t0,0($key)
|
||||
lwz $t1,4($key)
|
||||
rlwinm $acc02,$s2,`32-24`,24,31
|
||||
rlwinm $acc03,$s3,`32-24`,24,31
|
||||
rlwinm $acc00,$s0,`32-24`,24,31
|
||||
rlwinm $acc01,$s1,`32-24`,24,31
|
||||
lwz $t2,8($key)
|
||||
lwz $t3,12($key)
|
||||
rlwinm $acc02,$s2,`32-24`,24,31
|
||||
rlwinm $acc03,$s3,`32-24`,24,31
|
||||
lwz $acc08,`2048+0`($Tbl0) ! prefetch Td4
|
||||
lwz $acc09,`2048+32`($Tbl0)
|
||||
rlwinm $acc04,$s3,`32-16`,24,31
|
||||
rlwinm $acc05,$s0,`32-16`,24,31
|
||||
lwz $acc10,`2048+64`($Tbl0)
|
||||
lwz $acc11,`2048+96`($Tbl0)
|
||||
lbzx $acc00,$Tbl2,$acc00
|
||||
lbzx $acc01,$Tbl2,$acc01
|
||||
lwz $acc12,`2048+128`($Tbl0)
|
||||
lwz $acc13,`2048+160`($Tbl0)
|
||||
rlwinm $acc06,$s1,`32-16`,24,31
|
||||
rlwinm $acc07,$s2,`32-16`,24,31
|
||||
lbzx $acc02,$Tbl2,$acc02
|
||||
lbzx $acc03,$Tbl2,$acc03
|
||||
lwz $acc14,`2048+192`($Tbl0)
|
||||
lwz $acc15,`2048+224`($Tbl0)
|
||||
rlwinm $acc08,$s2,`32-8`,24,31
|
||||
rlwinm $acc09,$s3,`32-8`,24,31
|
||||
lbzx $acc04,$Tbl2,$acc04
|
||||
lbzx $acc05,$Tbl2,$acc05
|
||||
lbzx $acc02,$Tbl2,$acc02
|
||||
lbzx $acc03,$Tbl2,$acc03
|
||||
rlwinm $acc10,$s0,`32-8`,24,31
|
||||
rlwinm $acc11,$s1,`32-8`,24,31
|
||||
lbzx $acc06,$Tbl2,$acc06
|
||||
lbzx $acc07,$Tbl2,$acc07
|
||||
lbzx $acc04,$Tbl2,$acc04
|
||||
lbzx $acc05,$Tbl2,$acc05
|
||||
rlwinm $acc12,$s1,`0`,24,31
|
||||
rlwinm $acc13,$s2,`0`,24,31
|
||||
lbzx $acc08,$Tbl2,$acc08
|
||||
lbzx $acc09,$Tbl2,$acc09
|
||||
lbzx $acc06,$Tbl2,$acc06
|
||||
lbzx $acc07,$Tbl2,$acc07
|
||||
rlwinm $acc14,$s3,`0`,24,31
|
||||
rlwinm $acc15,$s0,`0`,24,31
|
||||
lbzx $acc10,$Tbl2,$acc10
|
||||
lbzx $acc11,$Tbl2,$acc11
|
||||
lbzx $acc08,$Tbl2,$acc08
|
||||
lbzx $acc09,$Tbl2,$acc09
|
||||
rlwinm $s0,$acc00,24,0,7
|
||||
rlwinm $s1,$acc01,24,0,7
|
||||
lbzx $acc12,$Tbl2,$acc12
|
||||
lbzx $acc13,$Tbl2,$acc13
|
||||
lbzx $acc10,$Tbl2,$acc10
|
||||
lbzx $acc11,$Tbl2,$acc11
|
||||
rlwinm $s2,$acc02,24,0,7
|
||||
rlwinm $s3,$acc03,24,0,7
|
||||
lbzx $acc14,$Tbl2,$acc14
|
||||
lbzx $acc15,$Tbl2,$acc15
|
||||
lbzx $acc12,$Tbl2,$acc12
|
||||
lbzx $acc13,$Tbl2,$acc13
|
||||
rlwimi $s0,$acc04,16,8,15
|
||||
rlwimi $s1,$acc05,16,8,15
|
||||
lbzx $acc14,$Tbl2,$acc14
|
||||
lbzx $acc15,$Tbl2,$acc15
|
||||
rlwimi $s2,$acc06,16,8,15
|
||||
rlwimi $s3,$acc07,16,8,15
|
||||
rlwimi $s0,$acc08,8,16,23
|
||||
@@ -897,40 +910,40 @@ Ldec_compact_loop:
|
||||
rlwinm $acc01,$s1,`32-24`,24,31
|
||||
rlwinm $acc02,$s2,`32-24`,24,31
|
||||
rlwinm $acc03,$s3,`32-24`,24,31
|
||||
lbzx $acc00,$Tbl1,$acc00
|
||||
lbzx $acc01,$Tbl1,$acc01
|
||||
rlwinm $acc04,$s3,`32-16`,24,31
|
||||
rlwinm $acc05,$s0,`32-16`,24,31
|
||||
lbzx $acc02,$Tbl1,$acc02
|
||||
lbzx $acc03,$Tbl1,$acc03
|
||||
rlwinm $acc06,$s1,`32-16`,24,31
|
||||
rlwinm $acc07,$s2,`32-16`,24,31
|
||||
lbzx $acc04,$Tbl1,$acc04
|
||||
lbzx $acc05,$Tbl1,$acc05
|
||||
lbzx $acc00,$Tbl1,$acc00
|
||||
lbzx $acc01,$Tbl1,$acc01
|
||||
rlwinm $acc08,$s2,`32-8`,24,31
|
||||
rlwinm $acc09,$s3,`32-8`,24,31
|
||||
lbzx $acc06,$Tbl1,$acc06
|
||||
lbzx $acc07,$Tbl1,$acc07
|
||||
lbzx $acc02,$Tbl1,$acc02
|
||||
lbzx $acc03,$Tbl1,$acc03
|
||||
rlwinm $acc10,$s0,`32-8`,24,31
|
||||
rlwinm $acc11,$s1,`32-8`,24,31
|
||||
lbzx $acc08,$Tbl1,$acc08
|
||||
lbzx $acc09,$Tbl1,$acc09
|
||||
lbzx $acc04,$Tbl1,$acc04
|
||||
lbzx $acc05,$Tbl1,$acc05
|
||||
rlwinm $acc12,$s1,`0`,24,31
|
||||
rlwinm $acc13,$s2,`0`,24,31
|
||||
lbzx $acc10,$Tbl1,$acc10
|
||||
lbzx $acc11,$Tbl1,$acc11
|
||||
lbzx $acc06,$Tbl1,$acc06
|
||||
lbzx $acc07,$Tbl1,$acc07
|
||||
rlwinm $acc14,$s3,`0`,24,31
|
||||
rlwinm $acc15,$s0,`0`,24,31
|
||||
lbzx $acc12,$Tbl1,$acc12
|
||||
lbzx $acc13,$Tbl1,$acc13
|
||||
lbzx $acc08,$Tbl1,$acc08
|
||||
lbzx $acc09,$Tbl1,$acc09
|
||||
rlwinm $s0,$acc00,24,0,7
|
||||
rlwinm $s1,$acc01,24,0,7
|
||||
lbzx $acc14,$Tbl1,$acc14
|
||||
lbzx $acc15,$Tbl1,$acc15
|
||||
lbzx $acc10,$Tbl1,$acc10
|
||||
lbzx $acc11,$Tbl1,$acc11
|
||||
rlwinm $s2,$acc02,24,0,7
|
||||
rlwinm $s3,$acc03,24,0,7
|
||||
lbzx $acc12,$Tbl1,$acc12
|
||||
lbzx $acc13,$Tbl1,$acc13
|
||||
rlwimi $s0,$acc04,16,8,15
|
||||
rlwimi $s1,$acc05,16,8,15
|
||||
lbzx $acc14,$Tbl1,$acc14
|
||||
lbzx $acc15,$Tbl1,$acc15
|
||||
rlwimi $s2,$acc06,16,8,15
|
||||
rlwimi $s3,$acc07,16,8,15
|
||||
rlwimi $s0,$acc08,8,16,23
|
||||
|
@@ -90,6 +90,7 @@ OPENSSL_rdtsc:
|
||||
OPENSSL_cleanse:
|
||||
.frame $30,0,$26
|
||||
.prologue 0
|
||||
beq $17,.Ldone
|
||||
and $16,7,$0
|
||||
bic $17,7,$at
|
||||
beq $at,.Little
|
||||
|
@@ -290,12 +290,12 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
|
||||
const unsigned char *p;
|
||||
unsigned char *data;
|
||||
int i;
|
||||
/* Sanity check OID encoding: can't have 0x80 in subidentifiers, see:
|
||||
* X.690 8.19.2
|
||||
/* Sanity check OID encoding: can't have leading 0x80 in
|
||||
* subidentifiers, see: X.690 8.19.2
|
||||
*/
|
||||
for (i = 0, p = *pp + 1; i < len - 1; i++, p++)
|
||||
{
|
||||
if (*p == 0x80)
|
||||
if (*p == 0x80 && (!i || !(p[-1] & 0x80)))
|
||||
{
|
||||
ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING);
|
||||
return NULL;
|
||||
|
@@ -731,7 +731,14 @@ again:
|
||||
#ifdef SO_REUSEADDR
|
||||
err_num=get_last_socket_error();
|
||||
if ((bind_mode == BIO_BIND_REUSEADDR_IF_UNUSED) &&
|
||||
#ifdef OPENSSL_SYS_WINDOWS
|
||||
/* Some versions of Windows define EADDRINUSE to
|
||||
* a dummy value.
|
||||
*/
|
||||
(err_num == WSAEADDRINUSE))
|
||||
#else
|
||||
(err_num == EADDRINUSE))
|
||||
#endif
|
||||
{
|
||||
client = server;
|
||||
if (h == NULL || strcmp(h,"*") == 0)
|
||||
|
@@ -118,10 +118,47 @@ static BIO_METHOD methods_filep=
|
||||
|
||||
BIO *BIO_new_file(const char *filename, const char *mode)
|
||||
{
|
||||
BIO *ret;
|
||||
FILE *file;
|
||||
BIO *ret;
|
||||
FILE *file=NULL;
|
||||
|
||||
if ((file=fopen(filename,mode)) == NULL)
|
||||
#if defined(_WIN32) && defined(CP_UTF8)
|
||||
int sz, len_0 = (int)strlen(filename)+1;
|
||||
|
||||
/*
|
||||
* Basically there are three cases to cover: a) filename is
|
||||
* pure ASCII string; b) actual UTF-8 encoded string and
|
||||
* c) locale-ized string, i.e. one containing 8-bit
|
||||
* characters that are meaningful in current system locale.
|
||||
* If filename is pure ASCII or real UTF-8 encoded string,
|
||||
* MultiByteToWideChar succeeds and _wfopen works. If
|
||||
* filename is locale-ized string, chances are that
|
||||
* MultiByteToWideChar fails reporting
|
||||
* ERROR_NO_UNICODE_TRANSLATION, in which case we fall
|
||||
* back to fopen...
|
||||
*/
|
||||
if ((sz=MultiByteToWideChar(CP_UTF8,MB_ERR_INVALID_CHARS,
|
||||
filename,len_0,NULL,0))>0)
|
||||
{
|
||||
WCHAR wmode[8];
|
||||
WCHAR *wfilename = _alloca(sz*sizeof(WCHAR));
|
||||
|
||||
if (MultiByteToWideChar(CP_UTF8,MB_ERR_INVALID_CHARS,
|
||||
filename,len_0,wfilename,sz) &&
|
||||
MultiByteToWideChar(CP_UTF8,0,mode,strlen(mode)+1,
|
||||
wmode,sizeof(wmode)/sizeof(wmode[0])) &&
|
||||
(file=_wfopen(wfilename,wmode))==NULL && errno==ENOENT
|
||||
) /* UTF-8 decode succeeded, but no file, filename
|
||||
* could still have been locale-ized... */
|
||||
file = fopen(filename,mode);
|
||||
}
|
||||
else if (GetLastError()==ERROR_NO_UNICODE_TRANSLATION)
|
||||
{
|
||||
file = fopen(filename,mode);
|
||||
}
|
||||
#else
|
||||
file=fopen(filename,mode);
|
||||
#endif
|
||||
if (file == NULL)
|
||||
{
|
||||
SYSerr(SYS_F_FOPEN,get_last_sys_error());
|
||||
ERR_add_error_data(5,"fopen('",filename,"','",mode,"')");
|
||||
@@ -272,9 +309,9 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
BIO_clear_flags(b,BIO_FLAGS_UPLINK);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef UP_fsetmode
|
||||
#ifdef UP_fsetmod
|
||||
if (b->flags&BIO_FLAGS_UPLINK)
|
||||
UP_fsetmode(b->ptr,num&BIO_FP_TEXT?'t':'b');
|
||||
UP_fsetmod(b->ptr,(char)((num&BIO_FP_TEXT)?'t':'b'));
|
||||
else
|
||||
#endif
|
||||
{
|
||||
|
@@ -172,15 +172,6 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case BIO_CTRL_RESET:
|
||||
num=0;
|
||||
case BIO_C_FILE_SEEK:
|
||||
ret=0;
|
||||
break;
|
||||
case BIO_C_FILE_TELL:
|
||||
case BIO_CTRL_INFO:
|
||||
ret=0;
|
||||
break;
|
||||
case BIO_C_SET_FD:
|
||||
sock_free(b);
|
||||
b->num= *((int *)ptr);
|
||||
@@ -203,10 +194,6 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
case BIO_CTRL_SET_CLOSE:
|
||||
b->shutdown=(int)num;
|
||||
break;
|
||||
case BIO_CTRL_PENDING:
|
||||
case BIO_CTRL_WPENDING:
|
||||
ret=0;
|
||||
break;
|
||||
case BIO_CTRL_DUP:
|
||||
case BIO_CTRL_FLUSH:
|
||||
ret=1;
|
||||
|
@@ -53,15 +53,15 @@ $code=<<___;
|
||||
.align 5
|
||||
.ent bn_mul_mont
|
||||
bn_mul_mont:
|
||||
lda sp,-40(sp)
|
||||
lda sp,-48(sp)
|
||||
stq ra,0(sp)
|
||||
stq s3,8(sp)
|
||||
stq s4,16(sp)
|
||||
stq s5,24(sp)
|
||||
stq fp,32(sp)
|
||||
mov sp,fp
|
||||
.mask 0x0400f000,-40
|
||||
.frame fp,40,ra
|
||||
.mask 0x0400f000,-48
|
||||
.frame fp,48,ra
|
||||
.prologue 0
|
||||
|
||||
.align 4
|
||||
@@ -306,7 +306,7 @@ bn_mul_mont:
|
||||
ldq s4,16(sp)
|
||||
ldq s5,24(sp)
|
||||
ldq fp,32(sp)
|
||||
lda sp,40(sp)
|
||||
lda sp,48(sp)
|
||||
ret (ra)
|
||||
.end bn_mul_mont
|
||||
.rdata
|
||||
|
@@ -193,6 +193,7 @@ bn_mul_mont:
|
||||
bx lr @ interoperable with Thumb ISA:-)
|
||||
.size bn_mul_mont,.-bn_mul_mont
|
||||
.asciz "Montgomery multiplication for ARMv4, CRYPTOGAMS by <appro\@openssl.org>"
|
||||
.align 2
|
||||
___
|
||||
|
||||
$code =~ s/\bbx\s+lr\b/.word\t0xe12fff1e/gm; # make it possible to compile with -march=armv4
|
||||
|
@@ -63,6 +63,7 @@
|
||||
|
||||
#undef mul
|
||||
#undef mul_add
|
||||
#undef sqr
|
||||
|
||||
/*
|
||||
* "m"(a), "+m"(r) is the way to favor DirectPath <20>-code;
|
||||
|
@@ -102,7 +102,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
|
||||
/* The next 2 are needed so we can do a dv->d[0]|=1 later
|
||||
* since BN_lshift1 will only work once there is a value :-) */
|
||||
BN_zero(dv);
|
||||
bn_wexpand(dv,1);
|
||||
if(bn_wexpand(dv,1) == NULL) goto end;
|
||||
dv->top=1;
|
||||
|
||||
if (!BN_lshift(D,D,nm-nd)) goto end;
|
||||
|
@@ -232,7 +232,8 @@ int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
|
||||
if (a->top < b->top) { at = b; bt = a; }
|
||||
else { at = a; bt = b; }
|
||||
|
||||
bn_wexpand(r, at->top);
|
||||
if(bn_wexpand(r, at->top) == NULL)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < bt->top; i++)
|
||||
{
|
||||
|
@@ -131,8 +131,8 @@ ASN1_NDEF_SEQUENCE(CMS_SignedData) = {
|
||||
} ASN1_NDEF_SEQUENCE_END(CMS_SignedData)
|
||||
|
||||
ASN1_SEQUENCE(CMS_OriginatorInfo) = {
|
||||
ASN1_IMP_SET_OF_OPT(CMS_SignedData, certificates, CMS_CertificateChoices, 0),
|
||||
ASN1_IMP_SET_OF_OPT(CMS_SignedData, crls, CMS_RevocationInfoChoice, 1)
|
||||
ASN1_IMP_SET_OF_OPT(CMS_OriginatorInfo, certificates, CMS_CertificateChoices, 0),
|
||||
ASN1_IMP_SET_OF_OPT(CMS_OriginatorInfo, crls, CMS_RevocationInfoChoice, 1)
|
||||
} ASN1_SEQUENCE_END(CMS_OriginatorInfo)
|
||||
|
||||
ASN1_NDEF_SEQUENCE(CMS_EncryptedContentInfo) = {
|
||||
|
@@ -406,7 +406,11 @@ int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain,
|
||||
return 0;
|
||||
}
|
||||
BIO_get_md_ctx(chain, &mtmp);
|
||||
if (EVP_MD_CTX_type(mtmp) == nid)
|
||||
if (EVP_MD_CTX_type(mtmp) == nid
|
||||
/* Workaround for broken implementations that use signature
|
||||
* algorithm OID instead of digest.
|
||||
*/
|
||||
|| EVP_MD_pkey_type(EVP_MD_CTX_md(mtmp)) == nid)
|
||||
{
|
||||
EVP_MD_CTX_copy_ex(mctx, mtmp);
|
||||
return 1;
|
||||
|
@@ -86,13 +86,12 @@ c_rle.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
c_rle.o: ../../include/openssl/symhacks.h c_rle.c
|
||||
c_zlib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
c_zlib.o: ../../include/openssl/comp.h ../../include/openssl/crypto.h
|
||||
c_zlib.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
|
||||
c_zlib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
c_zlib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
c_zlib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
c_zlib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
|
||||
c_zlib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
c_zlib.o: c_zlib.c
|
||||
c_zlib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
c_zlib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
c_zlib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
c_zlib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
c_zlib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
c_zlib.o: ../../include/openssl/symhacks.h c_zlib.c
|
||||
comp_err.o: ../../include/openssl/bio.h ../../include/openssl/comp.h
|
||||
comp_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
comp_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
|
@@ -749,6 +749,18 @@ int OPENSSL_isservice(void)
|
||||
{ HWINSTA h;
|
||||
DWORD len;
|
||||
WCHAR *name;
|
||||
static union { void *p; int (*f)(void); } _OPENSSL_isservice = { NULL };
|
||||
|
||||
if (_OPENSSL_isservice.p == NULL) {
|
||||
HANDLE h = GetModuleHandle(NULL);
|
||||
if (h != NULL)
|
||||
_OPENSSL_isservice.p = GetProcAddress(h,"_OPENSSL_isservice");
|
||||
if (_OPENSSL_isservice.p == NULL)
|
||||
_OPENSSL_isservice.p = (void *)-1;
|
||||
}
|
||||
|
||||
if (_OPENSSL_isservice.p != (void *)-1)
|
||||
return (*_OPENSSL_isservice.f)();
|
||||
|
||||
(void)GetDesktopWindow(); /* return value is ignored */
|
||||
|
||||
|
@@ -103,7 +103,6 @@ extern unsigned long OPENSSL_ia32cap_P;
|
||||
void OPENSSL_showfatal(const char *,...);
|
||||
void *OPENSSL_stderr(void);
|
||||
extern int OPENSSL_NONPIC_relocated;
|
||||
int OPENSSL_isservice(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ $ THEN
|
||||
$!
|
||||
$! The Architecture Is VAX
|
||||
$!
|
||||
$ ARCH := VAX
|
||||
$ ARCH = "VAX"
|
||||
$!
|
||||
$! Else...
|
||||
$!
|
||||
@@ -80,9 +80,11 @@ $! NOTE: Some might think this list ugly. However, it's made this way to
|
||||
$! reflect the SDIRS variable in [-]Makefile.org as closely as possible,
|
||||
$! thereby making it fairly easy to verify that the lists are the same.
|
||||
$!
|
||||
$ ET_WHIRLPOOL = "WHRLPOOL"
|
||||
$ IF ARCH .EQS. "VAX" THEN ET_WHIRLPOOL = ""
|
||||
$ ENCRYPT_TYPES = "Basic,"+ -
|
||||
"OBJECTS,"+ -
|
||||
"MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,WHRLPOOL,"+ -
|
||||
"MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,"+ET_WHIRLPOOL+","+ -
|
||||
"DES,AES,RC2,RC4,RC5,IDEA,BF,CAST,CAMELLIA,SEED,MODES,"+ -
|
||||
"BN,EC,RSA,DSA,ECDSA,DH,ECDH,DSO,ENGINE,"+ -
|
||||
"BUFFER,BIO,STACK,LHASH,RAND,ERR,"+ -
|
||||
@@ -367,7 +369,7 @@ $!
|
||||
$ IF F$TYPE('LIB_MODULE') .EQS. ""
|
||||
$ THEN
|
||||
$ WRITE SYS$ERROR ""
|
||||
$ WRITE SYS$ERROR "The module ",MODULE_NAME," does not exist. Continuing..."
|
||||
$ WRITE SYS$ERROR "The module ",MODULE_NAME1," does not exist. Continuing..."
|
||||
$ WRITE SYS$ERROR ""
|
||||
$ GOTO MODULE_NEXT
|
||||
$ ENDIF
|
||||
@@ -777,12 +779,12 @@ $! Else...
|
||||
$!
|
||||
$ ELSE
|
||||
$!
|
||||
$! Else, Check To See If P1 Has A Valid Arguement.
|
||||
$! Else, Check To See If P1 Has A Valid Argument.
|
||||
$!
|
||||
$ IF (P1.EQS."LIBRARY").OR.(P1.EQS."APPS")
|
||||
$ THEN
|
||||
$!
|
||||
$! A Valid Arguement.
|
||||
$! A Valid Argument.
|
||||
$!
|
||||
$ BUILDALL = P1
|
||||
$!
|
||||
@@ -810,7 +812,7 @@ $! Time To EXIT.
|
||||
$!
|
||||
$ EXIT
|
||||
$!
|
||||
$! End The Valid Arguement Check.
|
||||
$! End The Valid Argument Check.
|
||||
$!
|
||||
$ ENDIF
|
||||
$!
|
||||
@@ -863,7 +865,7 @@ $! Time To EXIT.
|
||||
$!
|
||||
$ EXIT
|
||||
$!
|
||||
$! End The Valid Arguement Check.
|
||||
$! End The Valid Argument Check.
|
||||
$!
|
||||
$ ENDIF
|
||||
$!
|
||||
@@ -1034,7 +1036,7 @@ $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
|
||||
THEN CC = "CC/DECC"
|
||||
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
|
||||
"/NOLIST/PREFIX=ALL" + -
|
||||
"/INCLUDE=(SYS$DISK:[],SYS$DISK:[.''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
|
||||
"/INCLUDE=(SYS$DISK:[],SYS$DISK:[._''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
|
||||
CCEXTRAFLAGS
|
||||
$!
|
||||
$! Define The Linker Options File Name.
|
||||
@@ -1068,7 +1070,7 @@ $ EXIT
|
||||
$ ENDIF
|
||||
$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
|
||||
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
|
||||
"/INCLUDE=(SYS$DISK:[],SYS$DISK:[.''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
|
||||
"/INCLUDE=(SYS$DISK:[],SYS$DISK:[._''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
|
||||
CCEXTRAFLAGS
|
||||
$ CCDEFS = """VAXC""," + CCDEFS
|
||||
$!
|
||||
@@ -1100,7 +1102,7 @@ $!
|
||||
$! Use GNU C...
|
||||
$!
|
||||
$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
|
||||
"/INCLUDE=(SYS$DISK:[],SYS$DISK:[.''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
|
||||
"/INCLUDE=(SYS$DISK:[],SYS$DISK:[._''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
|
||||
CCEXTRAFLAGS
|
||||
$!
|
||||
$! Define The Linker Options File Name.
|
||||
@@ -1150,7 +1152,7 @@ $! Show user the result
|
||||
$!
|
||||
$ WRITE/SYMBOL SYS$OUTPUT "Main C Compiling Command: ",CC
|
||||
$!
|
||||
$! Else The User Entered An Invalid Arguement.
|
||||
$! Else The User Entered An Invalid Argument.
|
||||
$!
|
||||
$ ELSE
|
||||
$!
|
||||
@@ -1168,7 +1170,7 @@ $! Time To EXIT.
|
||||
$!
|
||||
$ EXIT
|
||||
$!
|
||||
$! End The Valid Arguement Check.
|
||||
$! End The Valid Argument Check.
|
||||
$!
|
||||
$ ENDIF
|
||||
$!
|
||||
@@ -1263,7 +1265,7 @@ $! Print info
|
||||
$!
|
||||
$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB
|
||||
$!
|
||||
$! Else The User Entered An Invalid Arguement.
|
||||
$! Else The User Entered An Invalid Argument.
|
||||
$!
|
||||
$ ELSE
|
||||
$!
|
||||
|
@@ -545,6 +545,7 @@ void OpenSSLDie(const char *file,int line,const char *assertion);
|
||||
|
||||
unsigned long *OPENSSL_ia32cap_loc(void);
|
||||
#define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
|
||||
int OPENSSL_isservice(void);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
|
@@ -659,13 +659,13 @@ $! Else...
|
||||
$!
|
||||
$ ELSE
|
||||
$!
|
||||
$! Else, Check To See If P1 Has A Valid Arguement.
|
||||
$! Else, Check To See If P1 Has A Valid Argument.
|
||||
$!
|
||||
$ IF (P1.EQS."LIBRARY").OR.(P1.EQS."DESTEST").OR.(P1.EQS."SPEED") -
|
||||
.OR.(P1.EQS."RPW").OR.(P1.EQS."DES").OR.(P1.EQS."DES_OPTS")
|
||||
$ THEN
|
||||
$!
|
||||
$! A Valid Arguement.
|
||||
$! A Valid Argument.
|
||||
$!
|
||||
$ BUILDALL = P1
|
||||
$!
|
||||
@@ -678,7 +678,7 @@ $!
|
||||
$ WRITE SYS$OUTPUT ""
|
||||
$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
|
||||
$ WRITE SYS$OUTPUT ""
|
||||
$ WRITE SYS$OUTPUT " ALL : Just Build Everything.
|
||||
$ WRITE SYS$OUTPUT " ALL : Just Build Everything."
|
||||
$ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.CRYPTO.DES]LIBDES.OLB Library."
|
||||
$ WRITE SYS$OUTPUT " DESTEST : To Compile Just The [.xxx.EXE.CRYPTO.DES]DESTEST.EXE Program."
|
||||
$ WRITE SYS$OUTPUT " SPEED : To Compile Just The [.xxx.EXE.CRYPTO.DES]SPEED.EXE Program."
|
||||
@@ -697,7 +697,7 @@ $! Time To EXIT.
|
||||
$!
|
||||
$ EXIT
|
||||
$!
|
||||
$! End The Valid Arguement Check.
|
||||
$! End The Valid Argument Check.
|
||||
$!
|
||||
$ ENDIF
|
||||
$!
|
||||
@@ -754,7 +754,7 @@ $! Time To EXIT.
|
||||
$!
|
||||
$ EXIT
|
||||
$!
|
||||
$! End The Valid Arguement Check.
|
||||
$! End The Valid Argument Check.
|
||||
$!
|
||||
$ ENDIF
|
||||
$!
|
||||
@@ -978,7 +978,7 @@ $! Show user the result
|
||||
$!
|
||||
$ WRITE SYS$OUTPUT "Main Compiling Command: ",CC
|
||||
$!
|
||||
$! Else The User Entered An Invalid Arguement.
|
||||
$! Else The User Entered An Invalid Argument.
|
||||
$!
|
||||
$ ELSE
|
||||
$!
|
||||
|
@@ -122,10 +122,10 @@ struct desparams {
|
||||
/*
|
||||
* Encrypt an arbitrary sized buffer
|
||||
*/
|
||||
#define DESIOCBLOCK _IOWR(d, 6, struct desparams)
|
||||
#define DESIOCBLOCK _IOWR('d', 6, struct desparams)
|
||||
|
||||
/*
|
||||
* Encrypt of small amount of data, quickly
|
||||
*/
|
||||
#define DESIOCQUICK _IOWR(d, 7, struct desparams)
|
||||
#define DESIOCQUICK _IOWR('d', 7, struct desparams)
|
||||
|
||||
|
@@ -209,7 +209,7 @@ static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
|
||||
if (*p == (V_ASN1_SEQUENCE|V_ASN1_CONSTRUCTED))
|
||||
{
|
||||
ASN1_TYPE *t1, *t2;
|
||||
if(!(ndsa = d2i_ASN1_SEQUENCE_ANY(NULL, &p, pklen)));
|
||||
if(!(ndsa = d2i_ASN1_SEQUENCE_ANY(NULL, &p, pklen)))
|
||||
goto decerr;
|
||||
if (sk_ASN1_TYPE_num(ndsa) != 2)
|
||||
goto decerr;
|
||||
@@ -237,8 +237,16 @@ static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
|
||||
}
|
||||
else
|
||||
{
|
||||
const unsigned char *q = p;
|
||||
if (!(privkey=d2i_ASN1_INTEGER(NULL, &p, pklen)))
|
||||
goto decerr;
|
||||
if (privkey->type == V_ASN1_NEG_INTEGER)
|
||||
{
|
||||
p8->broken = PKCS8_NEG_PRIVKEY;
|
||||
ASN1_INTEGER_free(privkey);
|
||||
if (!(privkey=d2i_ASN1_UINTEGER(NULL, &q, pklen)))
|
||||
goto decerr;
|
||||
}
|
||||
if (ptype != V_ASN1_SEQUENCE)
|
||||
goto decerr;
|
||||
}
|
||||
|
@@ -78,6 +78,9 @@ DSO_METHOD *DSO_METHOD_dlfcn(void)
|
||||
#else
|
||||
|
||||
#ifdef HAVE_DLFCN_H
|
||||
# ifdef __osf__
|
||||
# define __EXTENSIONS__
|
||||
# endif
|
||||
# include <dlfcn.h>
|
||||
# define HAVE_DLINFO 1
|
||||
# if defined(_AIX) || defined(__CYGWIN__) || \
|
||||
|
@@ -176,8 +176,8 @@ int ec_GF2m_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)
|
||||
dest->poly[3] = src->poly[3];
|
||||
dest->poly[4] = src->poly[4];
|
||||
dest->poly[5] = src->poly[5];
|
||||
bn_wexpand(&dest->a, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2);
|
||||
bn_wexpand(&dest->b, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2);
|
||||
if (bn_wexpand(&dest->a, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) == NULL) return 0;
|
||||
if (bn_wexpand(&dest->b, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) == NULL) return 0;
|
||||
for (i = dest->a.top; i < dest->a.dmax; i++) dest->a.d[i] = 0;
|
||||
for (i = dest->b.top; i < dest->b.dmax; i++) dest->b.d[i] = 0;
|
||||
return 1;
|
||||
@@ -201,12 +201,12 @@ int ec_GF2m_simple_group_set_curve(EC_GROUP *group,
|
||||
|
||||
/* group->a */
|
||||
if (!BN_GF2m_mod_arr(&group->a, a, group->poly)) goto err;
|
||||
bn_wexpand(&group->a, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2);
|
||||
if(bn_wexpand(&group->a, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2) == NULL) goto err;
|
||||
for (i = group->a.top; i < group->a.dmax; i++) group->a.d[i] = 0;
|
||||
|
||||
/* group->b */
|
||||
if (!BN_GF2m_mod_arr(&group->b, b, group->poly)) goto err;
|
||||
bn_wexpand(&group->b, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2);
|
||||
if(bn_wexpand(&group->b, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2) == NULL) goto err;
|
||||
for (i = group->b.top; i < group->b.dmax; i++) group->b.d[i] = 0;
|
||||
|
||||
ret = 1;
|
||||
|
@@ -95,7 +95,7 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
|
||||
int ret = 0;
|
||||
long do_init = -1;
|
||||
STACK_OF(CONF_VALUE) *ecmds;
|
||||
CONF_VALUE *ecmd;
|
||||
CONF_VALUE *ecmd = NULL;
|
||||
char *ctrlname, *ctrlvalue;
|
||||
ENGINE *e = NULL;
|
||||
int soft = 0;
|
||||
@@ -157,7 +157,7 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
|
||||
return 1;
|
||||
}
|
||||
if (!e)
|
||||
return 0;
|
||||
goto err;
|
||||
}
|
||||
/* Allow "EMPTY" to mean no value: this allows a valid
|
||||
* "value" to be passed to ctrls of type NO_INPUT
|
||||
@@ -186,16 +186,27 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
|
||||
}
|
||||
else if (!ENGINE_ctrl_cmd_string(e,
|
||||
ctrlname, ctrlvalue, 0))
|
||||
return 0;
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
if (e && (do_init == -1) && !int_engine_init(e))
|
||||
{
|
||||
ecmd = NULL;
|
||||
goto err;
|
||||
}
|
||||
ret = 1;
|
||||
err:
|
||||
if (ret != 1)
|
||||
{
|
||||
ENGINEerr(ENGINE_F_INT_ENGINE_CONFIGURE, ENGINE_R_ENGINE_CONFIGURATION_ERROR);
|
||||
if (ecmd)
|
||||
ERR_add_error_data(6, "section=", ecmd->section,
|
||||
", name=", ecmd->name,
|
||||
", value=", ecmd->value);
|
||||
}
|
||||
if (e)
|
||||
ENGINE_free(e);
|
||||
return ret;
|
||||
|
@@ -90,7 +90,9 @@ static int get_asym_dev_crypto(void);
|
||||
static int open_dev_crypto(void);
|
||||
static int get_dev_crypto(void);
|
||||
static int get_cryptodev_ciphers(const int **cnids);
|
||||
/*static int get_cryptodev_digests(const int **cnids);*/
|
||||
#ifdef USE_CRYPTODEV_DIGESTS
|
||||
static int get_cryptodev_digests(const int **cnids);
|
||||
#endif
|
||||
static int cryptodev_usable_ciphers(const int **nids);
|
||||
static int cryptodev_usable_digests(const int **nids);
|
||||
static int cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
@@ -128,7 +130,7 @@ static int cryptodev_mod_exp_dh(const DH *dh, BIGNUM *r, const BIGNUM *a,
|
||||
static int cryptodev_dh_compute_key(unsigned char *key,
|
||||
const BIGNUM *pub_key, DH *dh);
|
||||
static int cryptodev_ctrl(ENGINE *e, int cmd, long i, void *p,
|
||||
void (*f)());
|
||||
void (*f)(void));
|
||||
void ENGINE_load_cryptodev(void);
|
||||
|
||||
static const ENGINE_CMD_DEFN cryptodev_defns[] = {
|
||||
@@ -153,7 +155,7 @@ static struct {
|
||||
{ 0, NID_undef, 0, 0, },
|
||||
};
|
||||
|
||||
#if 0
|
||||
#ifdef USE_CRYPTODEV_DIGESTS
|
||||
static struct {
|
||||
int id;
|
||||
int nid;
|
||||
@@ -259,13 +261,13 @@ get_cryptodev_ciphers(const int **cnids)
|
||||
return (count);
|
||||
}
|
||||
|
||||
#ifdef USE_CRYPTODEV_DIGESTS
|
||||
/*
|
||||
* Find out what digests /dev/crypto will let us have a session for.
|
||||
* XXX note, that some of these openssl doesn't deal with yet!
|
||||
* returning them here is harmless, as long as we return NULL
|
||||
* when asked for a handler in the cryptodev_engine_digests routine
|
||||
*/
|
||||
#if 0 /* not (yet?) used */
|
||||
static int
|
||||
get_cryptodev_digests(const int **cnids)
|
||||
{
|
||||
@@ -1015,10 +1017,18 @@ cryptodev_bn_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
goto err;
|
||||
kop.crk_iparams = 3;
|
||||
|
||||
if (cryptodev_asym(&kop, BN_num_bytes(m), r, 0, NULL) == -1) {
|
||||
if (cryptodev_asym(&kop, BN_num_bytes(m), r, 0, NULL)) {
|
||||
const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
|
||||
printf("OCF asym process failed, Running in software\n");
|
||||
ret = meth->bn_mod_exp(r, a, p, m, ctx, in_mont);
|
||||
|
||||
} else if (ECANCELED == kop.crk_status) {
|
||||
const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
|
||||
printf("OCF hardware operation cancelled. Running in Software\n");
|
||||
ret = meth->bn_mod_exp(r, a, p, m, ctx, in_mont);
|
||||
}
|
||||
/* else cryptodev operation worked ok ==> ret = 1*/
|
||||
|
||||
err:
|
||||
zapparams(&kop);
|
||||
return (ret);
|
||||
@@ -1062,10 +1072,18 @@ cryptodev_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
|
||||
goto err;
|
||||
kop.crk_iparams = 6;
|
||||
|
||||
if (cryptodev_asym(&kop, BN_num_bytes(rsa->n), r0, 0, NULL) == -1) {
|
||||
if (cryptodev_asym(&kop, BN_num_bytes(rsa->n), r0, 0, NULL)) {
|
||||
const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
|
||||
printf("OCF asym process failed, running in Software\n");
|
||||
ret = (*meth->rsa_mod_exp)(r0, I, rsa, ctx);
|
||||
|
||||
} else if (ECANCELED == kop.crk_status) {
|
||||
const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
|
||||
printf("OCF hardware operation cancelled. Running in Software\n");
|
||||
ret = (*meth->rsa_mod_exp)(r0, I, rsa, ctx);
|
||||
}
|
||||
/* else cryptodev operation worked ok ==> ret = 1*/
|
||||
|
||||
err:
|
||||
zapparams(&kop);
|
||||
return (ret);
|
||||
@@ -1201,7 +1219,8 @@ cryptodev_dsa_verify(const unsigned char *dgst, int dlen,
|
||||
kop.crk_iparams = 7;
|
||||
|
||||
if (cryptodev_asym(&kop, 0, NULL, 0, NULL) == 0) {
|
||||
dsaret = kop.crk_status;
|
||||
/*OCF success value is 0, if not zero, change dsaret to fail*/
|
||||
if(0 != kop.crk_status) dsaret = 0;
|
||||
} else {
|
||||
const DSA_METHOD *meth = DSA_OpenSSL();
|
||||
|
||||
@@ -1292,7 +1311,7 @@ static DH_METHOD cryptodev_dh = {
|
||||
* but I expect we'll want some options soon.
|
||||
*/
|
||||
static int
|
||||
cryptodev_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)())
|
||||
cryptodev_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void))
|
||||
{
|
||||
#ifdef HAVE_SYSLOG_R
|
||||
struct syslog_data sd = SYSLOG_DATA_INIT;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* crypto/engine/eng_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1999-2010 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
|
||||
@@ -126,6 +126,7 @@ static ERR_STRING_DATA ENGINE_str_reasons[]=
|
||||
{ERR_REASON(ENGINE_R_DSO_FAILURE) ,"DSO failure"},
|
||||
{ERR_REASON(ENGINE_R_DSO_NOT_FOUND) ,"dso not found"},
|
||||
{ERR_REASON(ENGINE_R_ENGINES_SECTION_ERROR),"engines section error"},
|
||||
{ERR_REASON(ENGINE_R_ENGINE_CONFIGURATION_ERROR),"engine configuration error"},
|
||||
{ERR_REASON(ENGINE_R_ENGINE_IS_NOT_IN_LIST),"engine is not in the list"},
|
||||
{ERR_REASON(ENGINE_R_ENGINE_SECTION_ERROR),"engine section error"},
|
||||
{ERR_REASON(ENGINE_R_FAILED_LOADING_PRIVATE_KEY),"failed loading private key"},
|
||||
|
@@ -413,6 +413,7 @@ ENGINE *ENGINE_by_id(const char *id)
|
||||
return iterator;
|
||||
}
|
||||
notfound:
|
||||
ENGINE_free(iterator);
|
||||
ENGINEerr(ENGINE_F_ENGINE_BY_ID,ENGINE_R_NO_SUCH_ENGINE);
|
||||
ERR_add_error_data(2, "id=", id);
|
||||
return NULL;
|
||||
|
@@ -254,6 +254,7 @@ ENGINE *engine_table_select_tmp(ENGINE_TABLE **table, int nid, const char *f, in
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
ERR_set_mark();
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
|
||||
/* Check again inside the lock otherwise we could race against cleanup
|
||||
* operations. But don't worry about a fprintf(stderr). */
|
||||
@@ -327,7 +328,7 @@ end:
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
|
||||
/* Whatever happened, any failed init()s are not failures in this
|
||||
* context, so clear our error state. */
|
||||
ERR_clear_error();
|
||||
ERR_pop_to_mark();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -794,6 +794,7 @@ void ERR_load_ENGINE_strings(void);
|
||||
#define ENGINE_R_DSO_FAILURE 104
|
||||
#define ENGINE_R_DSO_NOT_FOUND 132
|
||||
#define ENGINE_R_ENGINES_SECTION_ERROR 148
|
||||
#define ENGINE_R_ENGINE_CONFIGURATION_ERROR 102
|
||||
#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
|
||||
#define ENGINE_R_ENGINE_SECTION_ERROR 149
|
||||
#define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128
|
||||
|
@@ -81,7 +81,8 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u),
|
||||
ERR_error_string_n(l, buf, sizeof buf);
|
||||
BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf,
|
||||
file, line, (flags & ERR_TXT_STRING) ? data : "");
|
||||
cb(buf2, strlen(buf2), u);
|
||||
if (cb(buf2, strlen(buf2), u) <= 0)
|
||||
break; /* abort outputting the error report */
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -64,7 +64,7 @@
|
||||
|
||||
static int b64_write(BIO *h, const char *buf, int num);
|
||||
static int b64_read(BIO *h, char *buf, int size);
|
||||
/*static int b64_puts(BIO *h, const char *str); */
|
||||
static int b64_puts(BIO *h, const char *str);
|
||||
/*static int b64_gets(BIO *h, char *str, int size); */
|
||||
static long b64_ctrl(BIO *h, int cmd, long arg1, void *arg2);
|
||||
static int b64_new(BIO *h);
|
||||
@@ -96,7 +96,7 @@ static BIO_METHOD methods_b64=
|
||||
BIO_TYPE_BASE64,"base64 encoding",
|
||||
b64_write,
|
||||
b64_read,
|
||||
NULL, /* b64_puts, */
|
||||
b64_puts,
|
||||
NULL, /* b64_gets, */
|
||||
b64_ctrl,
|
||||
b64_new,
|
||||
@@ -127,6 +127,7 @@ static int b64_new(BIO *bi)
|
||||
bi->init=1;
|
||||
bi->ptr=(char *)ctx;
|
||||
bi->flags=0;
|
||||
bi->num = 0;
|
||||
return(1);
|
||||
}
|
||||
|
||||
@@ -151,6 +152,8 @@ static int b64_read(BIO *b, char *out, int outl)
|
||||
|
||||
if ((ctx == NULL) || (b->next_bio == NULL)) return(0);
|
||||
|
||||
BIO_clear_retry_flags(b);
|
||||
|
||||
if (ctx->encode != B64_DECODE)
|
||||
{
|
||||
ctx->encode=B64_DECODE;
|
||||
@@ -163,6 +166,7 @@ static int b64_read(BIO *b, char *out, int outl)
|
||||
/* First check if there are bytes decoded/encoded */
|
||||
if (ctx->buf_len > 0)
|
||||
{
|
||||
OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
|
||||
i=ctx->buf_len-ctx->buf_off;
|
||||
if (i > outl) i=outl;
|
||||
OPENSSL_assert(ctx->buf_off+i < (int)sizeof(ctx->buf));
|
||||
@@ -184,7 +188,6 @@ static int b64_read(BIO *b, char *out, int outl)
|
||||
ret_code=0;
|
||||
while (outl > 0)
|
||||
{
|
||||
|
||||
if (ctx->cont <= 0)
|
||||
break;
|
||||
|
||||
@@ -195,7 +198,7 @@ static int b64_read(BIO *b, char *out, int outl)
|
||||
{
|
||||
ret_code=i;
|
||||
|
||||
/* Should be continue next time we are called? */
|
||||
/* Should we continue next time we are called? */
|
||||
if (!BIO_should_retry(b->next_bio))
|
||||
{
|
||||
ctx->cont=i;
|
||||
@@ -285,19 +288,27 @@ static int b64_read(BIO *b, char *out, int outl)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctx->tmp_len=0;
|
||||
}
|
||||
/* If buffer isn't full and we can retry then
|
||||
* restart to read in more data.
|
||||
*/
|
||||
}
|
||||
else if ((i < B64_BLOCK_SIZE) && (ctx->cont > 0))
|
||||
{
|
||||
/* If buffer isn't full and we can retry then
|
||||
* restart to read in more data.
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
|
||||
if (BIO_get_flags(b) & BIO_FLAGS_BASE64_NO_NL)
|
||||
{
|
||||
int z,jj;
|
||||
|
||||
#if 0
|
||||
jj=(i>>2)<<2;
|
||||
#else
|
||||
jj = i & ~3; /* process per 4 */
|
||||
#endif
|
||||
z=EVP_DecodeBlock((unsigned char *)ctx->buf,
|
||||
(unsigned char *)ctx->tmp,jj);
|
||||
if (jj > 2)
|
||||
@@ -313,18 +324,15 @@ static int b64_read(BIO *b, char *out, int outl)
|
||||
* number consumed */
|
||||
if (jj != i)
|
||||
{
|
||||
memcpy((unsigned char *)ctx->tmp,
|
||||
(unsigned char *)&(ctx->tmp[jj]),i-jj);
|
||||
memmove(ctx->tmp, &ctx->tmp[jj], i-jj);
|
||||
ctx->tmp_len=i-jj;
|
||||
}
|
||||
ctx->buf_len=0;
|
||||
if (z > 0)
|
||||
{
|
||||
ctx->buf_len=z;
|
||||
i=1;
|
||||
}
|
||||
else
|
||||
i=z;
|
||||
i=z;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -357,14 +365,16 @@ static int b64_read(BIO *b, char *out, int outl)
|
||||
outl-=i;
|
||||
out+=i;
|
||||
}
|
||||
BIO_clear_retry_flags(b);
|
||||
/* BIO_clear_retry_flags(b); */
|
||||
BIO_copy_next_retry(b);
|
||||
return((ret == 0)?ret_code:ret);
|
||||
}
|
||||
|
||||
static int b64_write(BIO *b, const char *in, int inl)
|
||||
{
|
||||
int ret=inl,n,i;
|
||||
int ret=0;
|
||||
int n;
|
||||
int i;
|
||||
BIO_B64_CTX *ctx;
|
||||
|
||||
ctx=(BIO_B64_CTX *)b->ptr;
|
||||
@@ -379,6 +389,9 @@ static int b64_write(BIO *b, const char *in, int inl)
|
||||
EVP_EncodeInit(&(ctx->base64));
|
||||
}
|
||||
|
||||
OPENSSL_assert(ctx->buf_off < (int)sizeof(ctx->buf));
|
||||
OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
|
||||
OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
|
||||
n=ctx->buf_len-ctx->buf_off;
|
||||
while (n > 0)
|
||||
{
|
||||
@@ -388,7 +401,10 @@ static int b64_write(BIO *b, const char *in, int inl)
|
||||
BIO_copy_next_retry(b);
|
||||
return(i);
|
||||
}
|
||||
OPENSSL_assert(i <= n);
|
||||
ctx->buf_off+=i;
|
||||
OPENSSL_assert(ctx->buf_off <= (int)sizeof(ctx->buf));
|
||||
OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
|
||||
n-=i;
|
||||
}
|
||||
/* at this point all pending data has been written */
|
||||
@@ -405,18 +421,19 @@ static int b64_write(BIO *b, const char *in, int inl)
|
||||
{
|
||||
if (ctx->tmp_len > 0)
|
||||
{
|
||||
OPENSSL_assert(ctx->tmp_len <= 3);
|
||||
n=3-ctx->tmp_len;
|
||||
/* There's a teoretical possibility for this */
|
||||
/* There's a theoretical possibility for this */
|
||||
if (n > inl)
|
||||
n=inl;
|
||||
memcpy(&(ctx->tmp[ctx->tmp_len]),in,n);
|
||||
ctx->tmp_len+=n;
|
||||
ret += n;
|
||||
if (ctx->tmp_len < 3)
|
||||
break;
|
||||
ctx->buf_len=EVP_EncodeBlock(
|
||||
(unsigned char *)ctx->buf,
|
||||
(unsigned char *)ctx->tmp,
|
||||
ctx->tmp_len);
|
||||
ctx->buf_len=EVP_EncodeBlock((unsigned char *)ctx->buf,(unsigned char *)ctx->tmp,ctx->tmp_len);
|
||||
OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
|
||||
OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
|
||||
/* Since we're now done using the temporary
|
||||
buffer, the length should be 0'd */
|
||||
ctx->tmp_len=0;
|
||||
@@ -425,14 +442,16 @@ static int b64_write(BIO *b, const char *in, int inl)
|
||||
{
|
||||
if (n < 3)
|
||||
{
|
||||
memcpy(&(ctx->tmp[0]),in,n);
|
||||
memcpy(ctx->tmp,in,n);
|
||||
ctx->tmp_len=n;
|
||||
ret += n;
|
||||
break;
|
||||
}
|
||||
n-=n%3;
|
||||
ctx->buf_len=EVP_EncodeBlock(
|
||||
(unsigned char *)ctx->buf,
|
||||
(unsigned char *)in,n);
|
||||
ctx->buf_len=EVP_EncodeBlock((unsigned char *)ctx->buf,(const unsigned char *)in,n);
|
||||
OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
|
||||
OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
|
||||
ret += n;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -440,6 +459,9 @@ static int b64_write(BIO *b, const char *in, int inl)
|
||||
EVP_EncodeUpdate(&(ctx->base64),
|
||||
(unsigned char *)ctx->buf,&ctx->buf_len,
|
||||
(unsigned char *)in,n);
|
||||
OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
|
||||
OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
|
||||
ret += n;
|
||||
}
|
||||
inl-=n;
|
||||
in+=n;
|
||||
@@ -454,8 +476,11 @@ static int b64_write(BIO *b, const char *in, int inl)
|
||||
BIO_copy_next_retry(b);
|
||||
return((ret == 0)?i:ret);
|
||||
}
|
||||
OPENSSL_assert(i <= n);
|
||||
n-=i;
|
||||
ctx->buf_off+=i;
|
||||
OPENSSL_assert(ctx->buf_off <= (int)sizeof(ctx->buf));
|
||||
OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
|
||||
}
|
||||
ctx->buf_len=0;
|
||||
ctx->buf_off=0;
|
||||
@@ -486,6 +511,7 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
|
||||
break;
|
||||
case BIO_CTRL_WPENDING: /* More to write in buffer */
|
||||
OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
|
||||
ret=ctx->buf_len-ctx->buf_off;
|
||||
if ((ret == 0) && (ctx->encode != B64_NONE)
|
||||
&& (ctx->base64.num != 0))
|
||||
@@ -494,6 +520,7 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
|
||||
break;
|
||||
case BIO_CTRL_PENDING: /* More to read in buffer */
|
||||
OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
|
||||
ret=ctx->buf_len-ctx->buf_off;
|
||||
if (ret <= 0)
|
||||
ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
|
||||
@@ -565,3 +592,7 @@ static long b64_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int b64_puts(BIO *b, const char *str)
|
||||
{
|
||||
return b64_write(b,str,strlen(str));
|
||||
}
|
||||
|
@@ -361,8 +361,10 @@ again:
|
||||
case BIO_CTRL_DUP:
|
||||
dbio=(BIO *)ptr;
|
||||
dctx=(BIO_ENC_CTX *)dbio->ptr;
|
||||
memcpy(&(dctx->cipher),&(ctx->cipher),sizeof(ctx->cipher));
|
||||
dbio->init=1;
|
||||
EVP_CIPHER_CTX_init(&dctx->cipher);
|
||||
ret = EVP_CIPHER_CTX_copy(&dctx->cipher,&ctx->cipher);
|
||||
if (ret)
|
||||
dbio->init=1;
|
||||
break;
|
||||
default:
|
||||
ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
|
||||
|
@@ -175,6 +175,7 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
|
||||
{
|
||||
/* Same comment from evp_enc.c */
|
||||
EVPerr(EVP_F_EVP_DIGESTINIT_EX,EVP_R_INITIALIZATION_ERROR);
|
||||
ENGINE_finish(impl);
|
||||
return 0;
|
||||
}
|
||||
/* We'll use the ENGINE's private digest definition */
|
||||
|
@@ -325,7 +325,7 @@ struct evp_cipher_st
|
||||
#define EVP_CIPH_CBC_MODE 0x2
|
||||
#define EVP_CIPH_CFB_MODE 0x3
|
||||
#define EVP_CIPH_OFB_MODE 0x4
|
||||
#define EVP_CIPH_MODE 0x7
|
||||
#define EVP_CIPH_MODE 0xF0007
|
||||
/* Set if variable length cipher */
|
||||
#define EVP_CIPH_VARIABLE_LENGTH 0x8
|
||||
/* Set if the iv handling should be done by the cipher itself */
|
||||
@@ -340,6 +340,12 @@ struct evp_cipher_st
|
||||
#define EVP_CIPH_NO_PADDING 0x100
|
||||
/* cipher handles random key generation */
|
||||
#define EVP_CIPH_RAND_KEY 0x200
|
||||
/* cipher has its own additional copying logic */
|
||||
#define EVP_CIPH_CUSTOM_COPY 0x400
|
||||
/* Allow use default ASN1 get/set iv */
|
||||
#define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000
|
||||
/* Buffer length in bits not bytes: CFB1 mode only */
|
||||
#define EVP_CIPH_FLAG_LENGTH_BITS 0x2000
|
||||
|
||||
/* ctrl() values */
|
||||
|
||||
@@ -351,6 +357,7 @@ struct evp_cipher_st
|
||||
#define EVP_CTRL_SET_RC5_ROUNDS 0x5
|
||||
#define EVP_CTRL_RAND_KEY 0x6
|
||||
#define EVP_CTRL_PBE_PRF_NID 0x7
|
||||
#define EVP_CTRL_COPY 0x8
|
||||
|
||||
typedef struct evp_cipher_info_st
|
||||
{
|
||||
@@ -449,6 +456,7 @@ int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx);
|
||||
int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx);
|
||||
int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx);
|
||||
int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx);
|
||||
int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
|
||||
void * EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx);
|
||||
void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data);
|
||||
#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
|
||||
@@ -514,6 +522,7 @@ int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
|
||||
int EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s);
|
||||
|
||||
int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify);
|
||||
int EVP_read_pw_string_min(char *buf,int minlen,int maxlen,const char *prompt,int verify);
|
||||
void EVP_set_pw_prompt(const char *prompt);
|
||||
char * EVP_get_pw_prompt(void);
|
||||
|
||||
@@ -521,6 +530,10 @@ int EVP_BytesToKey(const EVP_CIPHER *type,const EVP_MD *md,
|
||||
const unsigned char *salt, const unsigned char *data,
|
||||
int datal, int count, unsigned char *key,unsigned char *iv);
|
||||
|
||||
void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags);
|
||||
void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags);
|
||||
int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx,int flags);
|
||||
|
||||
int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher,
|
||||
const unsigned char *key, const unsigned char *iv);
|
||||
int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl,
|
||||
@@ -1186,6 +1199,7 @@ void ERR_load_EVP_strings(void);
|
||||
#define EVP_F_ECDSA_PKEY2PKCS8 129
|
||||
#define EVP_F_ECKEY_PKEY2PKCS8 132
|
||||
#define EVP_F_EVP_CIPHERINIT_EX 123
|
||||
#define EVP_F_EVP_CIPHER_CTX_COPY 163
|
||||
#define EVP_F_EVP_CIPHER_CTX_CTRL 124
|
||||
#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
|
||||
#define EVP_F_EVP_DECRYPTFINAL_EX 101
|
||||
|
@@ -566,3 +566,38 @@ int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in)
|
||||
{
|
||||
if ((in == NULL) || (in->cipher == NULL))
|
||||
{
|
||||
EVPerr(EVP_F_EVP_CIPHER_CTX_COPY,EVP_R_INPUT_NOT_INITIALIZED);
|
||||
return 0;
|
||||
}
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
/* Make sure it's safe to copy a cipher context using an ENGINE */
|
||||
if (in->engine && !ENGINE_init(in->engine))
|
||||
{
|
||||
EVPerr(EVP_F_EVP_CIPHER_CTX_COPY,ERR_R_ENGINE_LIB);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
EVP_CIPHER_CTX_cleanup(out);
|
||||
memcpy(out,in,sizeof *out);
|
||||
|
||||
if (in->cipher_data && in->cipher->ctx_size)
|
||||
{
|
||||
out->cipher_data=OPENSSL_malloc(in->cipher->ctx_size);
|
||||
if (!out->cipher_data)
|
||||
{
|
||||
EVPerr(EVP_F_EVP_CIPHER_CTX_COPY,ERR_R_MALLOC_FAILURE);
|
||||
return 0;
|
||||
}
|
||||
memcpy(out->cipher_data,in->cipher_data,in->cipher->ctx_size);
|
||||
}
|
||||
|
||||
if (in->cipher->flags & EVP_CIPH_CUSTOM_COPY)
|
||||
return in->cipher->ctrl((EVP_CIPHER_CTX *)in, EVP_CTRL_COPY, 0, out);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -79,6 +79,7 @@ static ERR_STRING_DATA EVP_str_functs[]=
|
||||
{ERR_FUNC(EVP_F_ECDSA_PKEY2PKCS8), "ECDSA_PKEY2PKCS8"},
|
||||
{ERR_FUNC(EVP_F_ECKEY_PKEY2PKCS8), "ECKEY_PKEY2PKCS8"},
|
||||
{ERR_FUNC(EVP_F_EVP_CIPHERINIT_EX), "EVP_CipherInit_ex"},
|
||||
{ERR_FUNC(EVP_F_EVP_CIPHER_CTX_COPY), "EVP_CIPHER_CTX_copy"},
|
||||
{ERR_FUNC(EVP_F_EVP_CIPHER_CTX_CTRL), "EVP_CIPHER_CTX_ctrl"},
|
||||
{ERR_FUNC(EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH), "EVP_CIPHER_CTX_set_key_length"},
|
||||
{ERR_FUNC(EVP_F_EVP_DECRYPTFINAL_EX), "EVP_DecryptFinal_ex"},
|
||||
|
@@ -89,6 +89,11 @@ char *EVP_get_pw_prompt(void)
|
||||
* in the DES library -- if someone ever wants to disable DES,
|
||||
* this function will fail */
|
||||
int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify)
|
||||
{
|
||||
return EVP_read_pw_string_min(buf, 0, len, prompt, verify);
|
||||
}
|
||||
|
||||
int EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, int verify)
|
||||
{
|
||||
int ret;
|
||||
char buff[BUFSIZ];
|
||||
@@ -97,10 +102,10 @@ int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify)
|
||||
if ((prompt == NULL) && (prompt_string[0] != '\0'))
|
||||
prompt=prompt_string;
|
||||
ui = UI_new();
|
||||
UI_add_input_string(ui,prompt,0,buf,0,(len>=BUFSIZ)?BUFSIZ-1:len);
|
||||
UI_add_input_string(ui,prompt,0,buf,min,(len>=BUFSIZ)?BUFSIZ-1:len);
|
||||
if (verify)
|
||||
UI_add_verify_string(ui,prompt,0,
|
||||
buff,0,(len>=BUFSIZ)?BUFSIZ-1:len,buf);
|
||||
buff,min,(len>=BUFSIZ)?BUFSIZ-1:len,buf);
|
||||
ret = UI_process(ui);
|
||||
UI_free(ui);
|
||||
OPENSSL_cleanse(buff,BUFSIZ);
|
||||
|
@@ -295,3 +295,18 @@ int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags)
|
||||
{
|
||||
return (ctx->flags & flags);
|
||||
}
|
||||
|
||||
void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags)
|
||||
{
|
||||
ctx->flags |= flags;
|
||||
}
|
||||
|
||||
void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags)
|
||||
{
|
||||
ctx->flags &= ~flags;
|
||||
}
|
||||
|
||||
int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags)
|
||||
{
|
||||
return (ctx->flags & flags);
|
||||
}
|
||||
|
@@ -115,7 +115,7 @@ static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
if (inl<chunk) chunk=inl;\
|
||||
while(inl && inl>=chunk)\
|
||||
{\
|
||||
cprefix##_cfb##cbits##_encrypt(in, out, (long)(cbits==1?chunk*8:chunk), &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num, ctx->encrypt);\
|
||||
cprefix##_cfb##cbits##_encrypt(in, out, (long)((cbits==1) && !(ctx->flags & EVP_CIPH_FLAG_LENGTH_BITS) ?inl*8:inl), &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num, ctx->encrypt);\
|
||||
inl-=chunk;\
|
||||
in +=chunk;\
|
||||
out+=chunk;\
|
||||
@@ -167,10 +167,10 @@ BLOCK_CIPHER_def1(cname, ofb##cbits, ofb, OFB, kstruct, nid, 1, \
|
||||
get_asn1, ctrl)
|
||||
|
||||
#define BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, \
|
||||
iv_len, flags, init_key, cleanup, set_asn1, \
|
||||
flags, init_key, cleanup, set_asn1, \
|
||||
get_asn1, ctrl) \
|
||||
BLOCK_CIPHER_def1(cname, ecb, ecb, ECB, kstruct, nid, block_size, key_len, \
|
||||
iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
|
||||
0, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
|
||||
|
||||
#define BLOCK_CIPHER_defs(cname, kstruct, \
|
||||
nid, block_size, key_len, iv_len, cbits, flags, \
|
||||
@@ -181,7 +181,7 @@ BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, iv_len, cbits, \
|
||||
flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
|
||||
BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits, \
|
||||
flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
|
||||
BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, iv_len, flags, \
|
||||
BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, flags, \
|
||||
init_key, cleanup, set_asn1, get_asn1, ctrl)
|
||||
|
||||
|
||||
|
@@ -65,7 +65,9 @@
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/mdc2.h>
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
#include <openssl/rsa.h>
|
||||
#endif
|
||||
|
||||
static int init(EVP_MD_CTX *ctx)
|
||||
{ return MDC2_Init(ctx->md_data); }
|
||||
|
@@ -86,7 +86,7 @@ int EVP_add_digest(const EVP_MD *md)
|
||||
r=OBJ_NAME_add(OBJ_nid2ln(md->type),OBJ_NAME_TYPE_MD_METH,(const char *)md);
|
||||
if (r == 0) return(0);
|
||||
|
||||
if (md->type != md->pkey_type)
|
||||
if (md->pkey_type && md->type != md->pkey_type)
|
||||
{
|
||||
r=OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
|
||||
OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,name);
|
||||
|
@@ -177,6 +177,7 @@ static EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id)
|
||||
ret->operation = EVP_PKEY_OP_UNDEFINED;
|
||||
ret->pkey = pkey;
|
||||
ret->peerkey = NULL;
|
||||
ret->pkey_gencb = 0;
|
||||
if (pkey)
|
||||
CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY);
|
||||
ret->data = NULL;
|
||||
|
@@ -209,3 +209,9 @@ unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags)
|
||||
{
|
||||
EVP_MD_CTX_set_flags(&ctx->i_ctx, flags);
|
||||
EVP_MD_CTX_set_flags(&ctx->o_ctx, flags);
|
||||
EVP_MD_CTX_set_flags(&ctx->md_ctx, flags);
|
||||
}
|
||||
|
@@ -101,6 +101,7 @@ unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
|
||||
unsigned int *md_len);
|
||||
int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
|
||||
|
||||
void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -130,9 +130,11 @@ OPENSSL_wipe_cpu:
|
||||
.global OPENSSL_cleanse#
|
||||
.proc OPENSSL_cleanse#
|
||||
OPENSSL_cleanse:
|
||||
{ .mib; cmp.eq p6,p0=0,r33 // len==0
|
||||
#if defined(_HPUX_SOURCE) && !defined(_LP64)
|
||||
{ .mmi; addp4 r32=0,r32 };;
|
||||
addp4 r32=0,r32
|
||||
#endif
|
||||
(p6) br.ret.spnt b0 };;
|
||||
{ .mib; and r2=7,r32
|
||||
cmp.leu p6,p0=15,r33 // len>=15
|
||||
(p6) br.cond.dptk .Lot };;
|
||||
|
@@ -41,6 +41,7 @@ $ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN -
|
||||
CREATE/DIR/LOG WRK_SSLINCLUDE:
|
||||
$
|
||||
$ SDIRS := ,-
|
||||
_'ARCH',-
|
||||
OBJECTS,-
|
||||
MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,WHRLPOOL,-
|
||||
DES,AES,RC2,RC4,RC5,IDEA,BF,CAST,CAMELLIA,SEED,-
|
||||
@@ -49,8 +50,8 @@ $ SDIRS := ,-
|
||||
EVP,ASN1,PEM,X509,X509V3,CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,-
|
||||
UI,KRB5,-
|
||||
STORE,CMS,PQUEUE,TS,JPAKE
|
||||
$ EXHEADER_ := crypto.h,opensslv.h,opensslconf.h,ebcdic.h,symhacks.h,-
|
||||
ossl_typ.h
|
||||
$ EXHEADER_ := crypto.h,opensslv.h,ebcdic.h,symhacks.h,ossl_typ.h
|
||||
$ EXHEADER__'ARCH' := opensslconf.h
|
||||
$ EXHEADER_OBJECTS := objects.h,obj_mac.h
|
||||
$ EXHEADER_MD2 := md2.h
|
||||
$ EXHEADER_MD4 := md4.h
|
||||
@@ -119,7 +120,12 @@ $ IF D .EQS. ""
|
||||
$ THEN
|
||||
$ COPY 'tmp' WRK_SSLINCLUDE: /LOG
|
||||
$ ELSE
|
||||
$ COPY [.'D']'tmp' WRK_SSLINCLUDE: /LOG
|
||||
$ IF D .EQS. "_''ARCH'"
|
||||
$ THEN
|
||||
$ COPY [-.'ARCH'.CRYPTO]'tmp' WRK_SSLINCLUDE: /LOG
|
||||
$ ELSE
|
||||
$ COPY [.'D']'tmp' WRK_SSLINCLUDE: /LOG
|
||||
$ ENDIF
|
||||
$ ENDIF
|
||||
$ SET FILE/PROT=WORLD:RE WRK_SSLINCLUDE:'tmp'
|
||||
$ GOTO LOOP_SDIRS
|
||||
|
@@ -241,11 +241,11 @@
|
||||
#ifndef PEDANTIC
|
||||
# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
|
||||
# if defined(__s390x__)
|
||||
# define HOST_c2l(c,l) ({ asm ("lrv %0,0(%1)" \
|
||||
:"=r"(l) : "r"(c)); \
|
||||
# define HOST_c2l(c,l) ({ asm ("lrv %0,%1" \
|
||||
:"=d"(l) :"m"(*(const unsigned int *)(c)));\
|
||||
(c)+=4; (l); })
|
||||
# define HOST_l2c(l,c) ({ asm ("strv %0,0(%1)" \
|
||||
: : "r"(l),"r"(c) : "memory"); \
|
||||
# define HOST_l2c(l,c) ({ asm ("strv %1,%0" \
|
||||
:"=m"(*(unsigned int *)(c)) :"d"(l));\
|
||||
(c)+=4; (l); })
|
||||
# endif
|
||||
# endif
|
||||
|
@@ -914,7 +914,7 @@ md5_digest_block##offset: \
|
||||
nop 0x0 ; \
|
||||
br.cond.sptk.many md5_digest_GHI ; \
|
||||
} ;; \
|
||||
.endp md5digestBlock ## offset
|
||||
.endp md5_digest_block##offset
|
||||
|
||||
MD5FBLOCK(1)
|
||||
MD5FBLOCK(2)
|
||||
|
@@ -96,15 +96,15 @@ void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
#endif
|
||||
while (len>=16) {
|
||||
(*block)(ivec, ivec, key);
|
||||
for (n=0; n<16; n+=sizeof(size_t)) {
|
||||
for (; n<16; n+=sizeof(size_t)) {
|
||||
*(size_t*)(out+n) =
|
||||
*(size_t*)(ivec+n) ^= *(size_t*)(in+n);
|
||||
}
|
||||
len -= 16;
|
||||
out += 16;
|
||||
in += 16;
|
||||
n = 0;
|
||||
}
|
||||
n = 0;
|
||||
if (len) {
|
||||
(*block)(ivec, ivec, key);
|
||||
while (len--) {
|
||||
@@ -141,7 +141,7 @@ void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
#endif
|
||||
while (len>=16) {
|
||||
(*block)(ivec, ivec, key);
|
||||
for (n=0; n<16; n+=sizeof(size_t)) {
|
||||
for (; n<16; n+=sizeof(size_t)) {
|
||||
size_t t = *(size_t*)(in+n);
|
||||
*(size_t*)(out+n) = *(size_t*)(ivec+n) ^ t;
|
||||
*(size_t*)(ivec+n) = t;
|
||||
@@ -149,8 +149,8 @@ void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
len -= 16;
|
||||
out += 16;
|
||||
in += 16;
|
||||
n = 0;
|
||||
}
|
||||
n = 0;
|
||||
if (len) {
|
||||
(*block)(ivec, ivec, key);
|
||||
while (len--) {
|
||||
@@ -224,7 +224,6 @@ void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
|
||||
assert(in && out && key && ivec && num);
|
||||
assert(*num == 0);
|
||||
|
||||
memset(out,0,(bits+7)/8);
|
||||
for(n=0 ; n<bits ; ++n)
|
||||
{
|
||||
c[0]=(in[n/8]&(1 << (7-n%8))) ? 0x80 : 0;
|
||||
|
@@ -61,14 +61,11 @@
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned char u8;
|
||||
|
||||
# define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3]))
|
||||
# define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); }
|
||||
|
||||
#define STRICT_ALIGNMENT
|
||||
#if defined(__i386) || defined(__i386__) || \
|
||||
defined(__x86_64) || defined(__x86_64__) || \
|
||||
defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \
|
||||
defined(__s390__) || defined(__s390x__)
|
||||
#if defined(__i386) || defined(__i386__) || \
|
||||
defined(__x86_64) || defined(__x86_64__) || \
|
||||
defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \
|
||||
defined(__s390__) || defined(__s390x__)
|
||||
# undef STRICT_ALIGNMENT
|
||||
#endif
|
||||
|
||||
@@ -77,18 +74,19 @@ typedef unsigned char u8;
|
||||
|
||||
/* increment counter (128-bit int) by 1 */
|
||||
static void ctr128_inc(unsigned char *counter) {
|
||||
u32 c,n=16;
|
||||
u32 n=16;
|
||||
u8 c;
|
||||
|
||||
do {
|
||||
n -= 4;
|
||||
c = GETU32(counter+n);
|
||||
++c; c &= 0xFFFFFFFF;
|
||||
PUTU32(counter + n, c);
|
||||
--n;
|
||||
c = counter[n];
|
||||
++c;
|
||||
counter[n] = c;
|
||||
if (c) return;
|
||||
} while (n);
|
||||
}
|
||||
|
||||
#if !defined(OPENSSL_SMALL_FOORPRINT)
|
||||
#if !defined(OPENSSL_SMALL_FOOTPRINT)
|
||||
static void ctr128_inc_aligned(unsigned char *counter) {
|
||||
size_t *data,c,n;
|
||||
const union { long one; char little; } is_endian = {1};
|
||||
@@ -151,14 +149,14 @@ void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
while (len>=16) {
|
||||
(*block)(ivec, ecount_buf, key);
|
||||
ctr128_inc_aligned(ivec);
|
||||
for (n=0; n<16; n+=sizeof(size_t))
|
||||
for (; n<16; n+=sizeof(size_t))
|
||||
*(size_t *)(out+n) =
|
||||
*(size_t *)(in+n) ^ *(size_t *)(ecount_buf+n);
|
||||
len -= 16;
|
||||
out += 16;
|
||||
in += 16;
|
||||
n = 0;
|
||||
}
|
||||
n = 0;
|
||||
if (len) {
|
||||
(*block)(ivec, ecount_buf, key);
|
||||
ctr128_inc_aligned(ivec);
|
||||
|
@@ -95,14 +95,14 @@ void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
#endif
|
||||
while (len>=16) {
|
||||
(*block)(ivec, ivec, key);
|
||||
for (n=0; n<16; n+=sizeof(size_t))
|
||||
for (; n<16; n+=sizeof(size_t))
|
||||
*(size_t*)(out+n) =
|
||||
*(size_t*)(in+n) ^ *(size_t*)(ivec+n);
|
||||
len -= 16;
|
||||
out += 16;
|
||||
in += 16;
|
||||
n = 0;
|
||||
}
|
||||
n = 0;
|
||||
if (len) {
|
||||
(*block)(ivec, ivec, key);
|
||||
while (len--) {
|
||||
|
@@ -707,7 +707,7 @@ static const unsigned char lvalues[5824]={
|
||||
0x2B, /* [4582] OBJ_identified_organization */
|
||||
0x2B,0x81,0x04, /* [4583] OBJ_certicom_arc */
|
||||
0x67,0x2B, /* [4586] OBJ_wap */
|
||||
0x67,0x2B,0x0D, /* [4588] OBJ_wap_wsg */
|
||||
0x67,0x2B,0x01, /* [4588] OBJ_wap_wsg */
|
||||
0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,0x03, /* [4591] OBJ_X9_62_id_characteristic_two_basis */
|
||||
0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,0x03,0x01,/* [4599] OBJ_X9_62_onBasis */
|
||||
0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,0x03,0x02,/* [4608] OBJ_X9_62_tpBasis */
|
||||
@@ -763,17 +763,17 @@ static const unsigned char lvalues[5824]={
|
||||
0x2B,0x81,0x04,0x00,0x25, /* [4926] OBJ_sect409r1 */
|
||||
0x2B,0x81,0x04,0x00,0x26, /* [4931] OBJ_sect571k1 */
|
||||
0x2B,0x81,0x04,0x00,0x27, /* [4936] OBJ_sect571r1 */
|
||||
0x67,0x2B,0x0D,0x04,0x01, /* [4941] OBJ_wap_wsg_idm_ecid_wtls1 */
|
||||
0x67,0x2B,0x0D,0x04,0x03, /* [4946] OBJ_wap_wsg_idm_ecid_wtls3 */
|
||||
0x67,0x2B,0x0D,0x04,0x04, /* [4951] OBJ_wap_wsg_idm_ecid_wtls4 */
|
||||
0x67,0x2B,0x0D,0x04,0x05, /* [4956] OBJ_wap_wsg_idm_ecid_wtls5 */
|
||||
0x67,0x2B,0x0D,0x04,0x06, /* [4961] OBJ_wap_wsg_idm_ecid_wtls6 */
|
||||
0x67,0x2B,0x0D,0x04,0x07, /* [4966] OBJ_wap_wsg_idm_ecid_wtls7 */
|
||||
0x67,0x2B,0x0D,0x04,0x08, /* [4971] OBJ_wap_wsg_idm_ecid_wtls8 */
|
||||
0x67,0x2B,0x0D,0x04,0x09, /* [4976] OBJ_wap_wsg_idm_ecid_wtls9 */
|
||||
0x67,0x2B,0x0D,0x04,0x0A, /* [4981] OBJ_wap_wsg_idm_ecid_wtls10 */
|
||||
0x67,0x2B,0x0D,0x04,0x0B, /* [4986] OBJ_wap_wsg_idm_ecid_wtls11 */
|
||||
0x67,0x2B,0x0D,0x04,0x0C, /* [4991] OBJ_wap_wsg_idm_ecid_wtls12 */
|
||||
0x67,0x2B,0x01,0x04,0x01, /* [4941] OBJ_wap_wsg_idm_ecid_wtls1 */
|
||||
0x67,0x2B,0x01,0x04,0x03, /* [4946] OBJ_wap_wsg_idm_ecid_wtls3 */
|
||||
0x67,0x2B,0x01,0x04,0x04, /* [4951] OBJ_wap_wsg_idm_ecid_wtls4 */
|
||||
0x67,0x2B,0x01,0x04,0x05, /* [4956] OBJ_wap_wsg_idm_ecid_wtls5 */
|
||||
0x67,0x2B,0x01,0x04,0x06, /* [4961] OBJ_wap_wsg_idm_ecid_wtls6 */
|
||||
0x67,0x2B,0x01,0x04,0x07, /* [4966] OBJ_wap_wsg_idm_ecid_wtls7 */
|
||||
0x67,0x2B,0x01,0x04,0x08, /* [4971] OBJ_wap_wsg_idm_ecid_wtls8 */
|
||||
0x67,0x2B,0x01,0x04,0x09, /* [4976] OBJ_wap_wsg_idm_ecid_wtls9 */
|
||||
0x67,0x2B,0x01,0x04,0x0A, /* [4981] OBJ_wap_wsg_idm_ecid_wtls10 */
|
||||
0x67,0x2B,0x01,0x04,0x0B, /* [4986] OBJ_wap_wsg_idm_ecid_wtls11 */
|
||||
0x67,0x2B,0x01,0x04,0x0C, /* [4991] OBJ_wap_wsg_idm_ecid_wtls12 */
|
||||
0x55,0x1D,0x20,0x00, /* [4996] OBJ_any_policy */
|
||||
0x55,0x1D,0x21, /* [5000] OBJ_policy_mappings */
|
||||
0x55,0x1D,0x36, /* [5003] OBJ_inhibit_any_policy */
|
||||
@@ -4240,7 +4240,7 @@ static const unsigned int obj_objs[NUM_OBJ]={
|
||||
516, /* OBJ_set_policy 2 23 42 5 */
|
||||
517, /* OBJ_set_certExt 2 23 42 7 */
|
||||
518, /* OBJ_set_brand 2 23 42 8 */
|
||||
679, /* OBJ_wap_wsg 2 23 43 13 */
|
||||
679, /* OBJ_wap_wsg 2 23 43 1 */
|
||||
382, /* OBJ_Directory 1 3 6 1 1 */
|
||||
383, /* OBJ_Management 1 3 6 1 2 */
|
||||
384, /* OBJ_Experimental 1 3 6 1 3 */
|
||||
@@ -4426,17 +4426,17 @@ static const unsigned int obj_objs[NUM_OBJ]={
|
||||
629, /* OBJ_setAttr_IssCap_T2 2 23 42 3 3 4 */
|
||||
630, /* OBJ_setAttr_IssCap_Sig 2 23 42 3 3 5 */
|
||||
642, /* OBJ_set_brand_Novus 2 23 42 8 6011 */
|
||||
735, /* OBJ_wap_wsg_idm_ecid_wtls1 2 23 43 13 4 1 */
|
||||
736, /* OBJ_wap_wsg_idm_ecid_wtls3 2 23 43 13 4 3 */
|
||||
737, /* OBJ_wap_wsg_idm_ecid_wtls4 2 23 43 13 4 4 */
|
||||
738, /* OBJ_wap_wsg_idm_ecid_wtls5 2 23 43 13 4 5 */
|
||||
739, /* OBJ_wap_wsg_idm_ecid_wtls6 2 23 43 13 4 6 */
|
||||
740, /* OBJ_wap_wsg_idm_ecid_wtls7 2 23 43 13 4 7 */
|
||||
741, /* OBJ_wap_wsg_idm_ecid_wtls8 2 23 43 13 4 8 */
|
||||
742, /* OBJ_wap_wsg_idm_ecid_wtls9 2 23 43 13 4 9 */
|
||||
743, /* OBJ_wap_wsg_idm_ecid_wtls10 2 23 43 13 4 10 */
|
||||
744, /* OBJ_wap_wsg_idm_ecid_wtls11 2 23 43 13 4 11 */
|
||||
745, /* OBJ_wap_wsg_idm_ecid_wtls12 2 23 43 13 4 12 */
|
||||
735, /* OBJ_wap_wsg_idm_ecid_wtls1 2 23 43 1 4 1 */
|
||||
736, /* OBJ_wap_wsg_idm_ecid_wtls3 2 23 43 1 4 3 */
|
||||
737, /* OBJ_wap_wsg_idm_ecid_wtls4 2 23 43 1 4 4 */
|
||||
738, /* OBJ_wap_wsg_idm_ecid_wtls5 2 23 43 1 4 5 */
|
||||
739, /* OBJ_wap_wsg_idm_ecid_wtls6 2 23 43 1 4 6 */
|
||||
740, /* OBJ_wap_wsg_idm_ecid_wtls7 2 23 43 1 4 7 */
|
||||
741, /* OBJ_wap_wsg_idm_ecid_wtls8 2 23 43 1 4 8 */
|
||||
742, /* OBJ_wap_wsg_idm_ecid_wtls9 2 23 43 1 4 9 */
|
||||
743, /* OBJ_wap_wsg_idm_ecid_wtls10 2 23 43 1 4 10 */
|
||||
744, /* OBJ_wap_wsg_idm_ecid_wtls11 2 23 43 1 4 11 */
|
||||
745, /* OBJ_wap_wsg_idm_ecid_wtls12 2 23 43 1 4 12 */
|
||||
804, /* OBJ_whirlpool 1 0 10118 3 0 55 */
|
||||
124, /* OBJ_rle_compression 1 1 1 1 666 1 */
|
||||
773, /* OBJ_kisa 1 2 410 200004 */
|
||||
|
@@ -122,7 +122,7 @@
|
||||
|
||||
#define SN_wap_wsg "wap-wsg"
|
||||
#define NID_wap_wsg 679
|
||||
#define OBJ_wap_wsg OBJ_wap,13L
|
||||
#define OBJ_wap_wsg OBJ_wap,1L
|
||||
|
||||
#define SN_selected_attribute_types "selected-attribute-types"
|
||||
#define LN_selected_attribute_types "Selected Attribute Types"
|
||||
|
@@ -20,7 +20,7 @@ identified-organization 132 : certicom-arc
|
||||
joint-iso-itu-t 23 : international-organizations : International Organizations
|
||||
|
||||
international-organizations 43 : wap
|
||||
wap 13 : wap-wsg
|
||||
wap 1 : wap-wsg
|
||||
|
||||
joint-iso-itu-t 5 1 5 : selected-attribute-types : Selected Attribute Types
|
||||
|
||||
|
@@ -275,6 +275,7 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags)
|
||||
}
|
||||
if (!X509V3_extensions_print(bp, "Response Extensions",
|
||||
rd->responseExtensions, flags, 4))
|
||||
goto err;
|
||||
if(X509_signature_print(bp, br->signatureAlgorithm, br->signature) <= 0)
|
||||
goto err;
|
||||
|
||||
|
@@ -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 0x10000005L
|
||||
#define OPENSSL_VERSION_NUMBER 0x1000001fL
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0-fips-beta5 20 Jan 2010"
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0a-fips 1 Jun 2010"
|
||||
#else
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0-beta5 20 Jan 2010"
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0a 1 Jun 2010"
|
||||
#endif
|
||||
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
|
||||
|
||||
|
@@ -548,10 +548,11 @@ EVP_PKEY *b2i_PrivateKey_bio(BIO *in);
|
||||
EVP_PKEY *b2i_PublicKey_bio(BIO *in);
|
||||
int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk);
|
||||
int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk);
|
||||
|
||||
#ifndef OPENSSL_NO_RC4
|
||||
EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
|
||||
int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel,
|
||||
pem_password_cb *cb, void *u);
|
||||
#endif
|
||||
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
|
@@ -105,7 +105,7 @@ int PEM_def_callback(char *buf, int num, int w, void *key)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
i=EVP_read_pw_string(buf,num,prompt,w);
|
||||
i=EVP_read_pw_string_min(buf,MIN_LENGTH,num,prompt,w);
|
||||
if (i != 0)
|
||||
{
|
||||
PEMerr(PEM_F_PEM_DEF_CALLBACK,PEM_R_PROBLEMS_GETTING_PASSWORD);
|
||||
|
@@ -654,6 +654,8 @@ int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk)
|
||||
return do_i2b_bio(out, pk, 1);
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_RC4
|
||||
|
||||
static int do_PVK_header(const unsigned char **in, unsigned int length,
|
||||
int skip_magic,
|
||||
unsigned int *psaltlen, unsigned int *pkeylen)
|
||||
@@ -934,4 +936,7 @@ int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel,
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -101,6 +101,13 @@ my $bnelr = sub {
|
||||
" .long ".sprintf "0x%x",19<<26|$bo<<21|2<<16|16<<1 :
|
||||
" bclr $bo,2";
|
||||
};
|
||||
my $beqlr = sub {
|
||||
my $f = shift;
|
||||
my $bo = $f=~/-/ ? 12+2 : 12; # optional "not to be taken" hint
|
||||
($flavour =~ /linux/) ? # GNU as doesn't allow most recent hints
|
||||
" .long ".sprintf "0x%X",19<<26|$bo<<21|2<<16|16<<1 :
|
||||
" bclr $bo,2";
|
||||
};
|
||||
# GNU assembler can't handle extrdi rA,rS,16,48, or when sum of last two
|
||||
# arguments is 64, with "operand out of range" error.
|
||||
my $extrdi = sub {
|
||||
|
@@ -55,6 +55,8 @@
|
||||
# Win64 prologue copies %rsp value to %rax. For further details
|
||||
# see SEH paragraph at the end.
|
||||
# 9. .init segment is allowed to contain calls to functions only.
|
||||
# a. If function accepts more than 4 arguments *and* >4th argument
|
||||
# is declared as non 64-bit value, do clear its upper part.
|
||||
|
||||
my $flavour = shift;
|
||||
my $output = shift;
|
||||
@@ -80,7 +82,10 @@ my $PTR=" PTR";
|
||||
my $nasmref=2.03;
|
||||
my $nasm=0;
|
||||
|
||||
if ($flavour eq "mingw64") { $gas=1; $elf=0; $win64=1; $prefix="_"; }
|
||||
if ($flavour eq "mingw64") { $gas=1; $elf=0; $win64=1;
|
||||
$prefix=`echo __USER_LABEL_PREFIX__ | $ENV{CC} -E -P -`;
|
||||
chomp($prefix);
|
||||
}
|
||||
elsif ($flavour eq "macosx") { $gas=1; $elf=0; $prefix="_"; $decor="L\$"; }
|
||||
elsif ($flavour eq "masm") { $gas=0; $elf=0; $masm=$masmref; $win64=1; $decor="\$L\$"; }
|
||||
elsif ($flavour eq "nasm") { $gas=0; $elf=0; $nasm=$nasmref; $win64=1; $decor="\$L\$"; $PTR=""; }
|
||||
@@ -115,7 +120,9 @@ my %globals;
|
||||
$self->{op} = $1;
|
||||
$self->{sz} = "b";
|
||||
} elsif ($self->{op} =~ /call|jmp/) {
|
||||
$self->{sz} = ""
|
||||
$self->{sz} = "";
|
||||
} elsif ($self->{op} =~ /^p/ && $' !~ /^(ush|op)/) { # SSEn
|
||||
$self->{sz} = "";
|
||||
} elsif ($self->{op} =~ /([a-z]{3,})([qlwb])$/) {
|
||||
$self->{op} = $1;
|
||||
$self->{sz} = $2;
|
||||
@@ -191,7 +198,7 @@ my %globals;
|
||||
if ($gas) {
|
||||
# Solaris /usr/ccs/bin/as can't handle multiplications
|
||||
# in $self->{value}
|
||||
$self->{value} =~ s/(?<![0-9a-f])(0[x0-9a-f]+)/oct($1)/egi;
|
||||
$self->{value} =~ s/(?<![\w\$\.])(0x?[0-9a-f]+)/oct($1)/egi;
|
||||
$self->{value} =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg;
|
||||
sprintf "\$%s",$self->{value};
|
||||
} else {
|
||||
@@ -243,7 +250,7 @@ my %globals;
|
||||
# Solaris /usr/ccs/bin/as can't handle multiplications
|
||||
# in $self->{label}, new gas requires sign extension...
|
||||
use integer;
|
||||
$self->{label} =~ s/(?<![0-9a-f])(0[x0-9a-f]+)/oct($1)/egi;
|
||||
$self->{label} =~ s/(?<![\w\$\.])(0x?[0-9a-f]+)/oct($1)/egi;
|
||||
$self->{label} =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg;
|
||||
$self->{label} =~ s/([0-9]+)/$1<<32>>32/eg;
|
||||
$self->{label} =~ s/^___imp_/__imp__/ if ($flavour eq "mingw64");
|
||||
@@ -259,7 +266,7 @@ my %globals;
|
||||
%szmap = ( b=>"BYTE$PTR", w=>"WORD$PTR", l=>"DWORD$PTR", q=>"QWORD$PTR" );
|
||||
|
||||
$self->{label} =~ s/\./\$/g;
|
||||
$self->{label} =~ s/0x([0-9a-f]+)/0$1h/ig;
|
||||
$self->{label} =~ s/(?<![\w\$\.])0x([0-9a-f]+)/0$1h/ig;
|
||||
$self->{label} = "($self->{label})" if ($self->{label} =~ /[\*\+\-\/]/);
|
||||
$sz="q" if ($self->{asterisk});
|
||||
|
||||
@@ -574,7 +581,7 @@ my %globals;
|
||||
/\.align/ && do { $self->{value} = "ALIGN\t".$line; last; };
|
||||
/\.(value|long|rva|quad)/
|
||||
&& do { my $sz = substr($1,0,1);
|
||||
my @arr = split(',',$line);
|
||||
my @arr = split(/,\s*/,$line);
|
||||
my $last = pop(@arr);
|
||||
my $conv = sub { my $var=shift;
|
||||
$var=~s/^(0b[0-1]+)/oct($1)/eig;
|
||||
@@ -590,7 +597,7 @@ my %globals;
|
||||
$self->{value} .= &$conv($last);
|
||||
last;
|
||||
};
|
||||
/\.byte/ && do { my @str=split(",",$line);
|
||||
/\.byte/ && do { my @str=split(/,\s*/,$line);
|
||||
map(s/(0b[0-1]+)/oct($1)/eig,@str);
|
||||
map(s/0x([0-9a-f]+)/0$1h/ig,@str) if ($masm);
|
||||
while ($#str>15) {
|
||||
@@ -664,7 +671,7 @@ while($line=<>) {
|
||||
$insn = $opcode->out($#args>=1?$args[$#args]->size():$sz);
|
||||
} else {
|
||||
$insn = $opcode->out();
|
||||
$insn .= $sz if (map($_->out() =~ /xmm|mmx/,@args));
|
||||
$insn .= $sz if (map($_->out() =~ /x?mm/,@args));
|
||||
@args = reverse(@args);
|
||||
undef $sz if ($nasm && $opcode->mnemonic() eq "lea");
|
||||
}
|
||||
|
@@ -120,8 +120,13 @@ static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass)
|
||||
bags = PKCS12_unpack_p7data(p7);
|
||||
} else if (bagnid == NID_pkcs7_encrypted) {
|
||||
bags = PKCS12_unpack_p7encdata(p7, oldpass, -1);
|
||||
alg_get(p7->d.encrypted->enc_data->algorithm,
|
||||
&pbe_nid, &pbe_iter, &pbe_saltlen);
|
||||
if (!alg_get(p7->d.encrypted->enc_data->algorithm,
|
||||
&pbe_nid, &pbe_iter, &pbe_saltlen))
|
||||
{
|
||||
sk_PKCS12_SAFEBAG_pop_free(bags,
|
||||
PKCS12_SAFEBAG_free);
|
||||
bags = NULL;
|
||||
}
|
||||
} else continue;
|
||||
if (!bags) {
|
||||
sk_PKCS7_pop_free(asafes, PKCS7_free);
|
||||
@@ -193,7 +198,9 @@ static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass)
|
||||
if(M_PKCS12_bag_type(bag) != NID_pkcs8ShroudedKeyBag) return 1;
|
||||
|
||||
if (!(p8 = PKCS8_decrypt(bag->value.shkeybag, oldpass, -1))) return 0;
|
||||
alg_get(bag->value.shkeybag->algor, &p8_nid, &p8_iter, &p8_saltlen);
|
||||
if (!alg_get(bag->value.shkeybag->algor, &p8_nid, &p8_iter,
|
||||
&p8_saltlen))
|
||||
return 0;
|
||||
if(!(p8new = PKCS8_encrypt(p8_nid, NULL, newpass, -1, NULL, p8_saltlen,
|
||||
p8_iter, p8))) return 0;
|
||||
X509_SIG_free(bag->value.shkeybag);
|
||||
@@ -208,9 +215,11 @@ static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen)
|
||||
|
||||
p = alg->parameter->value.sequence->data;
|
||||
pbe = d2i_PBEPARAM(NULL, &p, alg->parameter->value.sequence->length);
|
||||
if (!pbe)
|
||||
return 0;
|
||||
*pnid = OBJ_obj2nid(alg->algorithm);
|
||||
*piter = ASN1_INTEGER_get(pbe->iter);
|
||||
*psaltlen = pbe->salt->length;
|
||||
PBEPARAM_free(pbe);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
@@ -67,6 +67,8 @@ Loop: lwarx r5,0,r3
|
||||
$CMPLI r4,7
|
||||
li r0,0
|
||||
bge Lot
|
||||
$CMPLI r4,0
|
||||
beqlr-
|
||||
Little: mtctr r4
|
||||
stb r0,0(r3)
|
||||
addi r3,r3,1
|
||||
|
@@ -527,6 +527,7 @@ int RAND_poll(void)
|
||||
RAND_add(&hentry,
|
||||
hentry.dwSize, 5);
|
||||
while (heap_next(&hentry)
|
||||
&& (!good || (GetTickCount()-starttime)<MAXDELAY)
|
||||
&& --entrycnt > 0);
|
||||
}
|
||||
}
|
||||
@@ -749,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())
|
||||
if (GetVersion() < 0x80000000 && OPENSSL_isservice()>0)
|
||||
return;
|
||||
|
||||
/* Create a screen DC and a memory DC compatible to screen DC */
|
||||
|
@@ -118,6 +118,14 @@ int RAND_load_file(const char *file, long bytes)
|
||||
if (file == NULL) return(0);
|
||||
|
||||
#ifndef OPENSSL_NO_POSIX_IO
|
||||
#ifdef PURIFY
|
||||
/* struct stat can have padding and unused fields that may not be
|
||||
* initialized in the call to stat(). We need to clear the entire
|
||||
* structure before calling RAND_add() to avoid complaints from
|
||||
* applications such as Valgrind.
|
||||
*/
|
||||
memset(&sb, 0, sizeof(sb));
|
||||
#endif
|
||||
if (stat(file,&sb) < 0) return(0);
|
||||
RAND_add(&sb,sizeof(sb),0.0);
|
||||
#endif
|
||||
|
@@ -246,6 +246,8 @@ static int pkey_rsa_verifyrecover(EVP_PKEY_CTX *ctx,
|
||||
ret = int_rsa_verify(EVP_MD_type(rctx->md),
|
||||
NULL, 0, rout, &sltmp,
|
||||
sig, siglen, ctx->pkey->pkey.rsa);
|
||||
if (ret <= 0)
|
||||
return 0;
|
||||
ret = sltmp;
|
||||
}
|
||||
else
|
||||
|
@@ -62,6 +62,8 @@ OPENSSL_cleanse:
|
||||
lghi %r0,0
|
||||
clgr %r3,%r4
|
||||
jh .Lot
|
||||
clgr %r3,%r0
|
||||
bcr 8,%r14
|
||||
.Little:
|
||||
stc %r0,0(%r2)
|
||||
la %r2,1(%r2)
|
||||
|
@@ -226,6 +226,7 @@ $code.=<<___;
|
||||
.LK_60_79: .word 0xca62c1d6
|
||||
.size sha1_block_data_order,.-sha1_block_data_order
|
||||
.asciz "SHA1 block transform for ARMv4, CRYPTOGAMS by <appro\@openssl.org>"
|
||||
.align 2
|
||||
___
|
||||
|
||||
$code =~ s/\bbx\s+lr\b/.word\t0xe12fff1e/gm; # make it possible to compile with -march=armv4
|
||||
|
@@ -172,6 +172,7 @@ $code.=<<___;
|
||||
bx lr @ interoperable with Thumb ISA:-)
|
||||
.size sha256_block_data_order,.-sha256_block_data_order
|
||||
.asciz "SHA256 block transform for ARMv4, CRYPTOGAMS by <appro\@openssl.org>"
|
||||
.align 2
|
||||
___
|
||||
|
||||
$code =~ s/\`([^\`]*)\`/eval $1/gem;
|
||||
|
@@ -390,6 +390,7 @@ $code.=<<___;
|
||||
bx lr @ interoperable with Thumb ISA:-)
|
||||
.size sha512_block_data_order,.-sha512_block_data_order
|
||||
.asciz "SHA512 block transform for ARMv4, CRYPTOGAMS by <appro\@openssl.org>"
|
||||
.align 2
|
||||
___
|
||||
|
||||
$code =~ s/\`([^\`]*)\`/eval $1/gem;
|
||||
|
@@ -179,7 +179,7 @@ OPENSSL_atomic_add:
|
||||
ba .enter
|
||||
nop
|
||||
#ifdef __sun
|
||||
! Note that you don't have to link with libthread to call thr_yield,
|
||||
! Note that you do not have to link with libthread to call thr_yield,
|
||||
! as libc provides a stub, which is overloaded the moment you link
|
||||
! with *either* libpthread or libthread...
|
||||
#define YIELD_CPU thr_yield
|
||||
@@ -242,6 +242,10 @@ OPENSSL_cleanse:
|
||||
#else
|
||||
bgu .Lot
|
||||
#endif
|
||||
cmp %o1,0
|
||||
bne .Little
|
||||
nop
|
||||
retl
|
||||
nop
|
||||
|
||||
.Little:
|
||||
|
@@ -179,7 +179,7 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
|
||||
sk_is_sorted(CHECKED_STACK_OF(type, st))
|
||||
|
||||
#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
|
||||
(STACK_OF(type) *)d2i_ASN1_SET(CHECKED_STACK_OF(type, st), \
|
||||
(STACK_OF(type) *)d2i_ASN1_SET((STACK_OF(OPENSSL_BLOCK) **)CHECKED_STACK_OF(type, st), \
|
||||
pp, length, \
|
||||
CHECKED_D2I_OF(type, d2i_func), \
|
||||
CHECKED_SK_FREE_FUNC(type, free_func), \
|
||||
@@ -2030,31 +2030,6 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
|
||||
#define sk_void_sort(st) SKM_sk_sort(void, (st))
|
||||
#define sk_void_is_sorted(st) SKM_sk_is_sorted(void, (st))
|
||||
|
||||
#define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp)))
|
||||
#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null())
|
||||
#define sk_OPENSSL_STRING_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val))
|
||||
#define sk_OPENSSL_STRING_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val))
|
||||
#define sk_OPENSSL_STRING_value(st, i) ((OPENSSL_STRING)sk_value(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), i))
|
||||
#define sk_OPENSSL_STRING_num(st) SKM_sk_num(OPENSSL_STRING, st)
|
||||
#define sk_OPENSSL_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_SK_FREE_FUNC2(OPENSSL_STRING, free_func))
|
||||
#define sk_OPENSSL_STRING_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val), i)
|
||||
#define sk_OPENSSL_STRING_free(st) SKM_sk_free(OPENSSL_STRING, st)
|
||||
#define sk_OPENSSL_STRING_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), i, CHECKED_PTR_OF(char, val))
|
||||
#define sk_OPENSSL_STRING_zero(st) SKM_sk_zero(OPENSSL_STRING, (st))
|
||||
#define sk_OPENSSL_STRING_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val))
|
||||
#define sk_OPENSSL_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_CONST_PTR_OF(char, val))
|
||||
#define sk_OPENSSL_STRING_delete(st, i) SKM_sk_delete(OPENSSL_STRING, (st), (i))
|
||||
#define sk_OPENSSL_STRING_delete_ptr(st, ptr) (OPENSSL_STRING *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, ptr))
|
||||
#define sk_OPENSSL_STRING_set_cmp_func(st, cmp) \
|
||||
((int (*)(const char * const *,const char * const *)) \
|
||||
sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_SK_CMP_FUNC(char, cmp)))
|
||||
#define sk_OPENSSL_STRING_dup(st) SKM_sk_dup(OPENSSL_STRING, st)
|
||||
#define sk_OPENSSL_STRING_shift(st) SKM_sk_shift(OPENSSL_STRING, (st))
|
||||
#define sk_OPENSSL_STRING_pop(st) (char *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st))
|
||||
#define sk_OPENSSL_STRING_sort(st) SKM_sk_sort(OPENSSL_STRING, (st))
|
||||
#define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st))
|
||||
|
||||
|
||||
#define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp)))
|
||||
#define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null())
|
||||
#define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_PTR_OF(void, val))
|
||||
@@ -2105,6 +2080,31 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
|
||||
#define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st))
|
||||
|
||||
|
||||
#define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp)))
|
||||
#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null())
|
||||
#define sk_OPENSSL_STRING_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val))
|
||||
#define sk_OPENSSL_STRING_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val))
|
||||
#define sk_OPENSSL_STRING_value(st, i) ((OPENSSL_STRING)sk_value(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), i))
|
||||
#define sk_OPENSSL_STRING_num(st) SKM_sk_num(OPENSSL_STRING, st)
|
||||
#define sk_OPENSSL_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_SK_FREE_FUNC2(OPENSSL_STRING, free_func))
|
||||
#define sk_OPENSSL_STRING_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val), i)
|
||||
#define sk_OPENSSL_STRING_free(st) SKM_sk_free(OPENSSL_STRING, st)
|
||||
#define sk_OPENSSL_STRING_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), i, CHECKED_PTR_OF(char, val))
|
||||
#define sk_OPENSSL_STRING_zero(st) SKM_sk_zero(OPENSSL_STRING, (st))
|
||||
#define sk_OPENSSL_STRING_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val))
|
||||
#define sk_OPENSSL_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_CONST_PTR_OF(char, val))
|
||||
#define sk_OPENSSL_STRING_delete(st, i) SKM_sk_delete(OPENSSL_STRING, (st), (i))
|
||||
#define sk_OPENSSL_STRING_delete_ptr(st, ptr) (OPENSSL_STRING *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, ptr))
|
||||
#define sk_OPENSSL_STRING_set_cmp_func(st, cmp) \
|
||||
((int (*)(const char * const *,const char * const *)) \
|
||||
sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_SK_CMP_FUNC(char, cmp)))
|
||||
#define sk_OPENSSL_STRING_dup(st) SKM_sk_dup(OPENSSL_STRING, st)
|
||||
#define sk_OPENSSL_STRING_shift(st) SKM_sk_shift(OPENSSL_STRING, (st))
|
||||
#define sk_OPENSSL_STRING_pop(st) (char *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st))
|
||||
#define sk_OPENSSL_STRING_sort(st) SKM_sk_sort(OPENSSL_STRING, (st))
|
||||
#define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st))
|
||||
|
||||
|
||||
#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
|
||||
SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
|
||||
#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \
|
||||
|
@@ -177,6 +177,15 @@
|
||||
#undef SSL_COMP_get_compression_methods
|
||||
#define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods
|
||||
|
||||
#undef ssl_add_clienthello_renegotiate_ext
|
||||
#define ssl_add_clienthello_renegotiate_ext ssl_add_clienthello_reneg_ext
|
||||
#undef ssl_add_serverhello_renegotiate_ext
|
||||
#define ssl_add_serverhello_renegotiate_ext ssl_add_serverhello_reneg_ext
|
||||
#undef ssl_parse_clienthello_renegotiate_ext
|
||||
#define ssl_parse_clienthello_renegotiate_ext ssl_parse_clienthello_reneg_ext
|
||||
#undef ssl_parse_serverhello_renegotiate_ext
|
||||
#define ssl_parse_serverhello_renegotiate_ext ssl_parse_serverhello_reneg_ext
|
||||
|
||||
/* 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
|
||||
@@ -390,6 +399,12 @@
|
||||
#undef dtls1_retransmit_buffered_messages
|
||||
#define dtls1_retransmit_buffered_messages dtls1_retransmit_buffered_msgs
|
||||
|
||||
/* Hack some long UI names */
|
||||
#undef UI_method_get_prompt_constructor
|
||||
#define UI_method_get_prompt_constructor UI_method_get_prompt_constructr
|
||||
#undef UI_method_set_prompt_constructor
|
||||
#define UI_method_set_prompt_constructor UI_method_set_prompt_constructr
|
||||
|
||||
#endif /* defined OPENSSL_SYS_VMS */
|
||||
|
||||
|
||||
|
@@ -60,7 +60,8 @@ links:
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
|
||||
install:
|
||||
@for i in $(EXHEADER) ; \
|
||||
@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
|
||||
@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
|
||||
do \
|
||||
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
|
||||
|
@@ -310,11 +310,13 @@ int UI_method_set_writer(UI_METHOD *method, int (*writer)(UI *ui, UI_STRING *uis
|
||||
int UI_method_set_flusher(UI_METHOD *method, int (*flusher)(UI *ui));
|
||||
int UI_method_set_reader(UI_METHOD *method, int (*reader)(UI *ui, UI_STRING *uis));
|
||||
int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui));
|
||||
int UI_method_set_prompt_constructor(UI_METHOD *method, char *(*prompt_constructor)(UI* ui, const char* object_desc, const char* object_name));
|
||||
int (*UI_method_get_opener(UI_METHOD *method))(UI*);
|
||||
int (*UI_method_get_writer(UI_METHOD *method))(UI*,UI_STRING*);
|
||||
int (*UI_method_get_flusher(UI_METHOD *method))(UI*);
|
||||
int (*UI_method_get_reader(UI_METHOD *method))(UI*,UI_STRING*);
|
||||
int (*UI_method_get_closer(UI_METHOD *method))(UI*);
|
||||
char* (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, const char*);
|
||||
|
||||
/* The following functions are helpers for method writers to access relevant
|
||||
data from a UI_STRING. */
|
||||
|
@@ -693,6 +693,17 @@ int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui))
|
||||
return -1;
|
||||
}
|
||||
|
||||
int UI_method_set_prompt_constructor(UI_METHOD *method, char *(*prompt_constructor)(UI* ui, const char* object_desc, const char* object_name))
|
||||
{
|
||||
if (method)
|
||||
{
|
||||
method->ui_construct_prompt = prompt_constructor;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
int (*UI_method_get_opener(UI_METHOD *method))(UI*)
|
||||
{
|
||||
if (method)
|
||||
@@ -733,6 +744,14 @@ int (*UI_method_get_closer(UI_METHOD *method))(UI*)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char* (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, const char*)
|
||||
{
|
||||
if (method)
|
||||
return method->ui_construct_prompt;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
enum UI_string_types UI_get_string_type(UI_STRING *uis)
|
||||
{
|
||||
if (!uis)
|
||||
|
@@ -420,11 +420,11 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
|
||||
|
||||
/* we have added it to the cache so now pull
|
||||
* it out again */
|
||||
CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
|
||||
j = sk_X509_OBJECT_find(xl->store_ctx->objs,&stmp);
|
||||
if(j != -1) tmp=sk_X509_OBJECT_value(xl->store_ctx->objs,j);
|
||||
else tmp = NULL;
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
|
||||
|
||||
/* If a CRL, update the last file suffix added for this */
|
||||
@@ -480,4 +480,3 @@ finish:
|
||||
if (b != NULL) BUF_MEM_free(b);
|
||||
return(ok);
|
||||
}
|
||||
|
||||
|
@@ -585,6 +585,7 @@ struct pkcs8_priv_key_info_st
|
||||
#define PKCS8_NO_OCTET 1
|
||||
#define PKCS8_EMBEDDED_PARAM 2
|
||||
#define PKCS8_NS_DB 3
|
||||
#define PKCS8_NEG_PRIVKEY 4
|
||||
ASN1_INTEGER *version;
|
||||
X509_ALGOR *pkeyalg;
|
||||
ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */
|
||||
|
@@ -294,7 +294,9 @@ int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name,
|
||||
X509_OBJECT stmp,*tmp;
|
||||
int i,j;
|
||||
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
|
||||
tmp=X509_OBJECT_retrieve_by_subject(ctx->objs,type,name);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
|
||||
if (tmp == NULL || type == X509_LU_CRL)
|
||||
{
|
||||
@@ -348,7 +350,6 @@ int X509_STORE_add_cert(X509_STORE *ctx, X509 *x)
|
||||
|
||||
X509_OBJECT_up_ref_count(obj);
|
||||
|
||||
|
||||
if (X509_OBJECT_retrieve_match(ctx->objs, obj))
|
||||
{
|
||||
X509_OBJECT_free_contents(obj);
|
||||
@@ -477,12 +478,12 @@ int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type,
|
||||
|
||||
X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, int type,
|
||||
X509_NAME *name)
|
||||
{
|
||||
{
|
||||
int idx;
|
||||
idx = X509_OBJECT_idx_by_subject(h, type, name);
|
||||
if (idx==-1) return NULL;
|
||||
return sk_X509_OBJECT_value(h, idx);
|
||||
}
|
||||
}
|
||||
|
||||
STACK_OF(X509)* X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm)
|
||||
{
|
||||
@@ -491,7 +492,7 @@ STACK_OF(X509)* X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm)
|
||||
X509 *x;
|
||||
X509_OBJECT *obj;
|
||||
sk = sk_X509_new_null();
|
||||
CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
|
||||
idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt);
|
||||
if (idx < 0)
|
||||
{
|
||||
@@ -499,18 +500,18 @@ STACK_OF(X509)* X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm)
|
||||
* objects to cache
|
||||
*/
|
||||
X509_OBJECT xobj;
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
if (!X509_STORE_get_by_subject(ctx, X509_LU_X509, nm, &xobj))
|
||||
{
|
||||
sk_X509_free(sk);
|
||||
return NULL;
|
||||
}
|
||||
X509_OBJECT_free_contents(&xobj);
|
||||
CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
|
||||
idx = x509_object_idx_cnt(ctx->ctx->objs,X509_LU_X509,nm, &cnt);
|
||||
if (idx < 0)
|
||||
{
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
sk_X509_free(sk);
|
||||
return NULL;
|
||||
}
|
||||
@@ -522,13 +523,13 @@ STACK_OF(X509)* X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm)
|
||||
CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509);
|
||||
if (!sk_X509_push(sk, x))
|
||||
{
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
X509_free(x);
|
||||
sk_X509_pop_free(sk, X509_free);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
return sk;
|
||||
|
||||
}
|
||||
@@ -540,24 +541,24 @@ STACK_OF(X509_CRL)* X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *nm)
|
||||
X509_CRL *x;
|
||||
X509_OBJECT *obj, xobj;
|
||||
sk = sk_X509_CRL_new_null();
|
||||
CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
|
||||
/* Check cache first */
|
||||
idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_CRL, nm, &cnt);
|
||||
|
||||
/* Always do lookup to possibly add new CRLs to cache
|
||||
*/
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
if (!X509_STORE_get_by_subject(ctx, X509_LU_CRL, nm, &xobj))
|
||||
{
|
||||
sk_X509_CRL_free(sk);
|
||||
return NULL;
|
||||
}
|
||||
X509_OBJECT_free_contents(&xobj);
|
||||
CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
|
||||
idx = x509_object_idx_cnt(ctx->ctx->objs,X509_LU_CRL, nm, &cnt);
|
||||
if (idx < 0)
|
||||
{
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
sk_X509_CRL_free(sk);
|
||||
return NULL;
|
||||
}
|
||||
@@ -569,19 +570,18 @@ STACK_OF(X509_CRL)* X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *nm)
|
||||
CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509_CRL);
|
||||
if (!sk_X509_CRL_push(sk, x))
|
||||
{
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
X509_CRL_free(x);
|
||||
sk_X509_CRL_pop_free(sk, X509_CRL_free);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
return sk;
|
||||
|
||||
}
|
||||
|
||||
X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x)
|
||||
{
|
||||
{
|
||||
int idx, i;
|
||||
X509_OBJECT *obj;
|
||||
idx = sk_X509_OBJECT_find(h, x);
|
||||
@@ -607,13 +607,13 @@ X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x
|
||||
return obj;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Try to get issuer certificate from store. Due to limitations
|
||||
* of the API this can only retrieve a single certificate matching
|
||||
* a given subject name. However it will fill the cache with all
|
||||
* matching certificates, so we can examine the cache for all
|
||||
* matching certificates, so we can examine the cache for all
|
||||
* matches.
|
||||
*
|
||||
* Return values are:
|
||||
@@ -621,13 +621,11 @@ X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x
|
||||
* 0 certificate not found.
|
||||
* -1 some other error.
|
||||
*/
|
||||
|
||||
|
||||
int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x)
|
||||
{
|
||||
{
|
||||
X509_NAME *xn;
|
||||
X509_OBJECT obj, *pobj;
|
||||
int i, ok, idx;
|
||||
int i, ok, idx, ret;
|
||||
xn=X509_get_issuer_name(x);
|
||||
ok=X509_STORE_get_by_subject(ctx,X509_LU_X509,xn,&obj);
|
||||
if (ok != X509_LU_X509)
|
||||
@@ -653,27 +651,34 @@ int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x)
|
||||
return 1;
|
||||
}
|
||||
X509_OBJECT_free_contents(&obj);
|
||||
/* Else find index of first matching cert */
|
||||
idx = X509_OBJECT_idx_by_subject(ctx->ctx->objs, X509_LU_X509, xn);
|
||||
/* This shouldn't normally happen since we already have one match */
|
||||
if (idx == -1) return 0;
|
||||
|
||||
/* Look through all matching certificates for a suitable issuer */
|
||||
for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs); i++)
|
||||
/* Else find index of first cert accepted by 'check_issued' */
|
||||
ret = 0;
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
|
||||
idx = X509_OBJECT_idx_by_subject(ctx->ctx->objs, X509_LU_X509, xn);
|
||||
if (idx != -1) /* should be true as we've had at least one match */
|
||||
{
|
||||
pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i);
|
||||
/* See if we've ran out of matches */
|
||||
if (pobj->type != X509_LU_X509) return 0;
|
||||
if (X509_NAME_cmp(xn, X509_get_subject_name(pobj->data.x509))) return 0;
|
||||
if (ctx->check_issued(ctx, x, pobj->data.x509))
|
||||
/* Look through all matching certs for suitable issuer */
|
||||
for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs); i++)
|
||||
{
|
||||
*issuer = pobj->data.x509;
|
||||
X509_OBJECT_up_ref_count(pobj);
|
||||
return 1;
|
||||
pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i);
|
||||
/* See if we've run past the matches */
|
||||
if (pobj->type != X509_LU_X509)
|
||||
break;
|
||||
if (X509_NAME_cmp(xn, X509_get_subject_name(pobj->data.x509)))
|
||||
break;
|
||||
if (ctx->check_issued(ctx, x, pobj->data.x509))
|
||||
{
|
||||
*issuer = pobj->data.x509;
|
||||
X509_OBJECT_up_ref_count(pobj);
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags)
|
||||
{
|
||||
|
@@ -128,7 +128,12 @@ static int process_pci_value(CONF_VALUE *val,
|
||||
unsigned char *tmp_data2 =
|
||||
string_to_hex(val->value + 4, &val_len);
|
||||
|
||||
if (!tmp_data2) goto err;
|
||||
if (!tmp_data2)
|
||||
{
|
||||
X509V3err(X509V3_F_PROCESS_PCI_VALUE,X509V3_R_ILLEGAL_HEX_DIGIT);
|
||||
X509V3_conf_err(val);
|
||||
goto err;
|
||||
}
|
||||
|
||||
tmp_data = OPENSSL_realloc((*policy)->data,
|
||||
(*policy)->length + val_len + 1);
|
||||
@@ -140,6 +145,17 @@ static int process_pci_value(CONF_VALUE *val,
|
||||
(*policy)->length += val_len;
|
||||
(*policy)->data[(*policy)->length] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
OPENSSL_free(tmp_data2);
|
||||
/* realloc failure implies the original data space is b0rked too! */
|
||||
(*policy)->data = NULL;
|
||||
(*policy)->length = 0;
|
||||
X509V3err(X509V3_F_PROCESS_PCI_VALUE,ERR_R_MALLOC_FAILURE);
|
||||
X509V3_conf_err(val);
|
||||
goto err;
|
||||
}
|
||||
OPENSSL_free(tmp_data2);
|
||||
}
|
||||
else if (strncmp(val->value, "file:", 5) == 0)
|
||||
{
|
||||
@@ -169,6 +185,7 @@ static int process_pci_value(CONF_VALUE *val,
|
||||
(*policy)->length += n;
|
||||
(*policy)->data[(*policy)->length] = '\0';
|
||||
}
|
||||
BIO_free_all(b);
|
||||
|
||||
if (n < 0)
|
||||
{
|
||||
@@ -190,6 +207,15 @@ static int process_pci_value(CONF_VALUE *val,
|
||||
(*policy)->length += val_len;
|
||||
(*policy)->data[(*policy)->length] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
/* realloc failure implies the original data space is b0rked too! */
|
||||
(*policy)->data = NULL;
|
||||
(*policy)->length = 0;
|
||||
X509V3err(X509V3_F_PROCESS_PCI_VALUE,ERR_R_MALLOC_FAILURE);
|
||||
X509V3_conf_err(val);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user