openssl 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of openssl might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/History.md +49 -1
- data/ext/openssl/deprecation.rb +1 -1
- data/ext/openssl/extconf.rb +48 -6
- data/ext/openssl/ossl_bn.c +1 -1
- data/ext/openssl/ossl_cipher.c +4 -4
- data/ext/openssl/ossl_ns_spki.c +2 -2
- data/ext/openssl/ossl_pkey_ec.c +3 -3
- data/ext/openssl/ossl_pkey_rsa.c +1 -1
- data/ext/openssl/ossl_ssl.c +2 -1
- data/ext/openssl/ossl_version.h +1 -1
- data/ext/openssl/ossl_x509store.c +9 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7038b25fd54bd0c3d69ac67508d48f28e755abda
|
4
|
+
data.tar.gz: 93d386d03cf4ef0639cf0278d2e048dd0ed7b5dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1898849090209058a85e5fe2478dec5eb286dfadbd183d53197eb3fa856bb21a1232fafc2b66250676b552aaa43775f7eec5fa26634c559ebe888a2ea97f38b
|
7
|
+
data.tar.gz: 5ee71162da1ff99aed88c3aab1acbed70c6e6686cd8c163f908eb743cbc31c33283cb4577aa9945207d8cc950963f1497e038b443b6d69ce248d150036505eb1
|
data/History.md
CHANGED
@@ -1,3 +1,50 @@
|
|
1
|
+
Version 2.0.4
|
2
|
+
=============
|
3
|
+
|
4
|
+
Bug fixes
|
5
|
+
---------
|
6
|
+
|
7
|
+
* It now compiles with LibreSSL without renaming on Windows (mswin).
|
8
|
+
* A workaround for the error queue leak of X509_load_cert_crl_file() that
|
9
|
+
causes random errors is added.
|
10
|
+
[[Bug #11033]](https://bugs.ruby-lang.org/issues/11033)
|
11
|
+
|
12
|
+
|
13
|
+
Version 2.0.3
|
14
|
+
=============
|
15
|
+
|
16
|
+
Bug fixes
|
17
|
+
---------
|
18
|
+
|
19
|
+
* OpenSSL::ASN1::Constructive#each which was broken by 2.0.0 is fixed.
|
20
|
+
[[ruby/openssl#96]](https://github.com/ruby/openssl/pull/96)
|
21
|
+
* Fixed build with static OpenSSL libraries on Windows.
|
22
|
+
[[Bug #13080]](https://bugs.ruby-lang.org/issues/13080)
|
23
|
+
* OpenSSL::X509::Name#eql? which was broken by 2.0.0 is fixed.
|
24
|
+
|
25
|
+
|
26
|
+
Version 2.0.2
|
27
|
+
=============
|
28
|
+
|
29
|
+
Bug fixes
|
30
|
+
---------
|
31
|
+
|
32
|
+
* Fix build with early 0.9.8 series which did not have SSL_CTX_clear_options().
|
33
|
+
[ruby-core:78693]
|
34
|
+
|
35
|
+
|
36
|
+
Version 2.0.1
|
37
|
+
=============
|
38
|
+
|
39
|
+
Bug fixes
|
40
|
+
---------
|
41
|
+
|
42
|
+
* A GC issue around OpenSSL::BN is fixed.
|
43
|
+
[[ruby/openssl#87]](https://github.com/ruby/openssl/issues/87)
|
44
|
+
* OpenSSL::ASN1 now parses BER encoding of GeneralizedTime without seconds.
|
45
|
+
[[ruby/openssl#88]](https://github.com/ruby/openssl/pull/88)
|
46
|
+
|
47
|
+
|
1
48
|
Version 2.0.0
|
2
49
|
=============
|
3
50
|
|
@@ -23,7 +70,8 @@ Supported platforms
|
|
23
70
|
Notable changes
|
24
71
|
---------------
|
25
72
|
|
26
|
-
* Add support for OpenSSL 1.1.0.
|
73
|
+
* Add support for OpenSSL 1.1.0.
|
74
|
+
[[Feature #12324]](https://bugs.ruby-lang.org/issues/12324)
|
27
75
|
* Add support for LibreSSL
|
28
76
|
|
29
77
|
* OpenSSL::Cipher
|
data/ext/openssl/deprecation.rb
CHANGED
@@ -3,7 +3,7 @@ module OpenSSL
|
|
3
3
|
def self.deprecated_warning_flag
|
4
4
|
unless flag = (@deprecated_warning_flag ||= nil)
|
5
5
|
if try_compile("", flag = "-Werror=deprecated-declarations")
|
6
|
-
if with_config("broken-apple-openssl")
|
6
|
+
if /darwin/ =~ RUBY_PLATFORM and with_config("broken-apple-openssl")
|
7
7
|
flag = "-Wno-deprecated-declarations"
|
8
8
|
end
|
9
9
|
$warnflags << " #{flag}"
|
data/ext/openssl/extconf.rb
CHANGED
@@ -36,17 +36,59 @@ have_library("socket", "socket")
|
|
36
36
|
|
37
37
|
Logging::message "=== Checking for required stuff... ===\n"
|
38
38
|
result = pkg_config("openssl") && have_header("openssl/ssl.h")
|
39
|
-
|
39
|
+
|
40
|
+
def find_openssl_library
|
40
41
|
if $mswin || $mingw
|
41
42
|
# required for static OpenSSL libraries
|
42
43
|
have_library("gdi32") # OpenSSL <= 1.0.2 (for RAND_screen())
|
43
44
|
have_library("crypt32")
|
44
45
|
end
|
45
46
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
return false unless have_header("openssl/ssl.h")
|
48
|
+
|
49
|
+
ret = have_library("crypto", "CRYPTO_malloc") &&
|
50
|
+
have_library("ssl", "SSL_new")
|
51
|
+
return ret if ret
|
52
|
+
|
53
|
+
if $mswin
|
54
|
+
# OpenSSL >= 1.1.0: libcrypto.lib and libssl.lib.
|
55
|
+
if have_library("libcrypto", "CRYPTO_malloc") &&
|
56
|
+
have_library("libssl", "SSL_new")
|
57
|
+
return true
|
58
|
+
end
|
59
|
+
|
60
|
+
# OpenSSL <= 1.0.2: libeay32.lib and ssleay32.lib.
|
61
|
+
if have_library("libeay32", "CRYPTO_malloc") &&
|
62
|
+
have_library("ssleay32", "SSL_new")
|
63
|
+
return true
|
64
|
+
end
|
65
|
+
|
66
|
+
# LibreSSL: libcrypto-##.lib and libssl-##.lib, where ## is the ABI version
|
67
|
+
# number. We have to find the version number out by scanning libpath.
|
68
|
+
libpath = $LIBPATH.dup
|
69
|
+
libpath |= ENV["LIB"].split(File::PATH_SEPARATOR)
|
70
|
+
libpath.map! { |d| d.tr(File::ALT_SEPARATOR, File::SEPARATOR) }
|
71
|
+
|
72
|
+
ret = [
|
73
|
+
["crypto", "CRYPTO_malloc"],
|
74
|
+
["ssl", "SSL_new"]
|
75
|
+
].all? do |base, func|
|
76
|
+
result = false
|
77
|
+
libs = ["lib#{base}-[0-9][0-9]", "lib#{base}-[0-9][0-9][0-9]"]
|
78
|
+
libs = Dir.glob(libs.map{|l| libpath.map{|d| File.join(d, l + ".*")}}.flatten).map{|path| File.basename(path, ".*")}.uniq
|
79
|
+
libs.each do |lib|
|
80
|
+
result = have_library(lib, func)
|
81
|
+
break if result
|
82
|
+
end
|
83
|
+
result
|
84
|
+
end
|
85
|
+
return ret if ret
|
86
|
+
end
|
87
|
+
return false
|
88
|
+
end
|
89
|
+
|
90
|
+
unless result
|
91
|
+
unless find_openssl_library
|
50
92
|
Logging::message "=== Checking for required stuff failed. ===\n"
|
51
93
|
Logging::message "Makefile wasn't created. Fix the errors above.\n"
|
52
94
|
exit 1
|
@@ -60,7 +102,7 @@ unless result
|
|
60
102
|
raise "OpenSSL 0.9.8 or later required."
|
61
103
|
end
|
62
104
|
|
63
|
-
|
105
|
+
if /darwin/ =~ RUBY_PLATFORM and !OpenSSL.check_func("SSL_library_init()", "openssl/ssl.h")
|
64
106
|
raise "Ignore OpenSSL broken by Apple.\nPlease use another openssl. (e.g. using `configure --with-openssl-dir=/path/to/openssl')"
|
65
107
|
end
|
66
108
|
|
data/ext/openssl/ossl_bn.c
CHANGED
@@ -129,7 +129,7 @@ try_convert_to_bn(VALUE obj)
|
|
129
129
|
if (rb_obj_is_kind_of(obj, cBN))
|
130
130
|
return obj;
|
131
131
|
if (RB_INTEGER_TYPE_P(obj)) {
|
132
|
-
newobj = NewBN(cBN); /* Handle
|
132
|
+
newobj = NewBN(cBN); /* Handle potential mem leaks */
|
133
133
|
bn = integer_to_bnptr(obj, NULL);
|
134
134
|
SetBN(newobj, bn);
|
135
135
|
}
|
data/ext/openssl/ossl_cipher.c
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
#define GetCipher(obj, ctx) do { \
|
24
24
|
GetCipherInit((obj), (ctx)); \
|
25
25
|
if (!(ctx)) { \
|
26
|
-
ossl_raise(rb_eRuntimeError, "Cipher not
|
26
|
+
ossl_raise(rb_eRuntimeError, "Cipher not initialized!"); \
|
27
27
|
} \
|
28
28
|
} while (0)
|
29
29
|
#define SafeGetCipher(obj, ctx) do { \
|
@@ -122,7 +122,7 @@ ossl_cipher_initialize(VALUE self, VALUE str)
|
|
122
122
|
name = StringValueCStr(str);
|
123
123
|
GetCipherInit(self, ctx);
|
124
124
|
if (ctx) {
|
125
|
-
ossl_raise(rb_eRuntimeError, "Cipher already
|
125
|
+
ossl_raise(rb_eRuntimeError, "Cipher already initialized!");
|
126
126
|
}
|
127
127
|
AllocCipher(self, ctx);
|
128
128
|
if (!(cipher = EVP_get_cipherbyname(name))) {
|
@@ -418,7 +418,7 @@ ossl_cipher_update(int argc, VALUE *argv, VALUE self)
|
|
418
418
|
* Returns the remaining data held in the cipher object. Further calls to
|
419
419
|
* Cipher#update or Cipher#final will return garbage. This call should always
|
420
420
|
* be made as the last call of an encryption or decryption operation, after
|
421
|
-
*
|
421
|
+
* having fed the entire plaintext or ciphertext to the Cipher instance.
|
422
422
|
*
|
423
423
|
* If an authenticated cipher was used, a CipherError is raised if the tag
|
424
424
|
* could not be authenticated successfully. Only call this method after
|
@@ -1023,7 +1023,7 @@ Init_ossl_cipher(void)
|
|
1023
1023
|
* An example using the GCM (Galois/Counter Mode). You have 16 bytes +key+,
|
1024
1024
|
* 12 bytes (96 bits) +nonce+ and the associated data +auth_data+. Be sure
|
1025
1025
|
* not to reuse the +key+ and +nonce+ pair. Reusing an nonce ruins the
|
1026
|
-
* security
|
1026
|
+
* security guarantees of GCM mode.
|
1027
1027
|
*
|
1028
1028
|
* cipher = OpenSSL::Cipher::AES.new(128, :GCM).encrypt
|
1029
1029
|
* cipher.key = key
|
data/ext/openssl/ossl_ns_spki.c
CHANGED
@@ -322,7 +322,7 @@ ossl_spki_verify(VALUE self, VALUE key)
|
|
322
322
|
|
323
323
|
/* Document-class: OpenSSL::Netscape::SPKI
|
324
324
|
*
|
325
|
-
* A Simple Public Key Infrastructure implementation (pronounced "
|
325
|
+
* A Simple Public Key Infrastructure implementation (pronounced "spooky").
|
326
326
|
* The structure is defined as
|
327
327
|
* PublicKeyAndChallenge ::= SEQUENCE {
|
328
328
|
* spki SubjectPublicKeyInfo,
|
@@ -348,7 +348,7 @@ ossl_spki_verify(VALUE self, VALUE key)
|
|
348
348
|
* spki.public_key = key.public_key
|
349
349
|
* spki.sign(key, OpenSSL::Digest::SHA256.new)
|
350
350
|
* #send a request containing this to a server generating a certificate
|
351
|
-
* ===
|
351
|
+
* === Verifying an SPKI request
|
352
352
|
* request = #...
|
353
353
|
* spki = OpenSSL::Netscape::SPKI.new request
|
354
354
|
* unless spki.verify(spki.public_key)
|
data/ext/openssl/ossl_pkey_ec.c
CHANGED
@@ -296,7 +296,7 @@ ossl_ec_key_get_group(VALUE self)
|
|
296
296
|
* key.group = group
|
297
297
|
*
|
298
298
|
* Sets the EC::Group for the key. The group structure is internally copied so
|
299
|
-
*
|
299
|
+
* modification to +group+ after assigning to a key has no effect on the key.
|
300
300
|
*/
|
301
301
|
static VALUE
|
302
302
|
ossl_ec_key_set_group(VALUE self, VALUE group_v)
|
@@ -1597,11 +1597,11 @@ ossl_ec_point_to_bn(int argc, VALUE *argv, VALUE self)
|
|
1597
1597
|
* Performs elliptic curve point multiplication.
|
1598
1598
|
*
|
1599
1599
|
* The first form calculates <tt>bn1 * point + bn2 * G</tt>, where +G+ is the
|
1600
|
-
* generator of the group of +point+. +bn2+ may be
|
1600
|
+
* generator of the group of +point+. +bn2+ may be omitted, and in that case,
|
1601
1601
|
* the result is just <tt>bn1 * point</tt>.
|
1602
1602
|
*
|
1603
1603
|
* The second form calculates <tt>bns[0] * point + bns[1] * points[0] + ...
|
1604
|
-
* + bns[-1] * points[-1] + bn2 * G</tt>. +bn2+ may be
|
1604
|
+
* + bns[-1] * points[-1] + bn2 * G</tt>. +bn2+ may be omitted. +bns+ must be
|
1605
1605
|
* an array of OpenSSL::BN. +points+ must be an array of
|
1606
1606
|
* OpenSSL::PKey::EC::Point. Please note that <tt>points[0]</tt> is not
|
1607
1607
|
* multiplied by <tt>bns[0]</tt>, but <tt>bns[1]</tt>.
|
data/ext/openssl/ossl_pkey_rsa.c
CHANGED
@@ -706,7 +706,7 @@ Init_ossl_rsa(void)
|
|
706
706
|
/* Document-class: OpenSSL::PKey::RSA
|
707
707
|
*
|
708
708
|
* RSA is an asymmetric public key algorithm that has been formalized in
|
709
|
-
* RFC 3447. It is in widespread use in public key
|
709
|
+
* RFC 3447. It is in widespread use in public key infrastructures (PKI)
|
710
710
|
* where certificates (cf. OpenSSL::X509::Certificate) often are issued
|
711
711
|
* on the basis of a public/private RSA key pair. RSA is used in a wide
|
712
712
|
* field of applications such as secure (symmetric) key exchange, e.g.
|
data/ext/openssl/ossl_ssl.c
CHANGED
@@ -1483,7 +1483,8 @@ ossl_ssl_setup(VALUE self)
|
|
1483
1483
|
GetOpenFile(io, fptr);
|
1484
1484
|
rb_io_check_readable(fptr);
|
1485
1485
|
rb_io_check_writable(fptr);
|
1486
|
-
SSL_set_fd(ssl, TO_SOCKET(FPTR_TO_FD(fptr)))
|
1486
|
+
if (!SSL_set_fd(ssl, TO_SOCKET(FPTR_TO_FD(fptr))))
|
1487
|
+
ossl_raise(eSSLError, "SSL_set_fd");
|
1487
1488
|
|
1488
1489
|
return Qtrue;
|
1489
1490
|
}
|
data/ext/openssl/ossl_version.h
CHANGED
@@ -342,6 +342,15 @@ ossl_x509store_add_file(VALUE self, VALUE file)
|
|
342
342
|
if(X509_LOOKUP_load_file(lookup, path, X509_FILETYPE_PEM) != 1){
|
343
343
|
ossl_raise(eX509StoreError, NULL);
|
344
344
|
}
|
345
|
+
#if OPENSSL_VERSION_NUMBER < 0x10101000 || defined(LIBRESSL_VERSION_NUMBER)
|
346
|
+
/*
|
347
|
+
* X509_load_cert_crl_file() which is called from X509_LOOKUP_load_file()
|
348
|
+
* did not check the return value of X509_STORE_add_{cert,crl}(), leaking
|
349
|
+
* "cert already in hash table" errors on the error queue, if duplicate
|
350
|
+
* certificates are found. This will be fixed by OpenSSL 1.1.1.
|
351
|
+
*/
|
352
|
+
ossl_clear_error();
|
353
|
+
#endif
|
345
354
|
|
346
355
|
return self;
|
347
356
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openssl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Bosslet
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2017-
|
14
|
+
date: 2017-06-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rake
|
@@ -77,8 +77,8 @@ extensions:
|
|
77
77
|
- ext/openssl/extconf.rb
|
78
78
|
extra_rdoc_files:
|
79
79
|
- CONTRIBUTING.md
|
80
|
-
- History.md
|
81
80
|
- README.md
|
81
|
+
- History.md
|
82
82
|
files:
|
83
83
|
- BSDL
|
84
84
|
- CONTRIBUTING.md
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: '0'
|
172
172
|
requirements: []
|
173
173
|
rubyforge_project:
|
174
|
-
rubygems_version: 2.6.
|
174
|
+
rubygems_version: 2.6.12
|
175
175
|
signing_key:
|
176
176
|
specification_version: 4
|
177
177
|
summary: OpenSSL provides SSL, TLS and general purpose cryptography.
|