openssl 2.1.3 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +35 -45
- data/History.md +237 -1
- data/README.md +2 -2
- data/ext/openssl/extconf.rb +46 -38
- data/ext/openssl/openssl_missing.c +0 -66
- data/ext/openssl/openssl_missing.h +59 -43
- data/ext/openssl/ossl.c +110 -64
- data/ext/openssl/ossl.h +27 -10
- data/ext/openssl/ossl_asn1.c +41 -4
- data/ext/openssl/ossl_bn.c +251 -134
- data/ext/openssl/ossl_bn.h +2 -1
- data/ext/openssl/ossl_cipher.c +38 -29
- data/ext/openssl/ossl_config.c +412 -41
- data/ext/openssl/ossl_config.h +4 -7
- data/ext/openssl/ossl_digest.c +25 -60
- data/ext/openssl/ossl_engine.c +18 -27
- data/ext/openssl/ossl_hmac.c +60 -145
- data/ext/openssl/ossl_kdf.c +11 -19
- data/ext/openssl/ossl_ns_spki.c +1 -1
- data/ext/openssl/ossl_ocsp.c +9 -62
- data/ext/openssl/ossl_ocsp.h +3 -3
- data/ext/openssl/ossl_pkcs12.c +21 -3
- data/ext/openssl/ossl_pkcs7.c +45 -78
- data/ext/openssl/ossl_pkcs7.h +16 -0
- data/ext/openssl/ossl_pkey.c +1295 -178
- data/ext/openssl/ossl_pkey.h +35 -72
- data/ext/openssl/ossl_pkey_dh.c +124 -334
- data/ext/openssl/ossl_pkey_dsa.c +93 -398
- data/ext/openssl/ossl_pkey_ec.c +159 -318
- data/ext/openssl/ossl_pkey_rsa.c +105 -484
- data/ext/openssl/ossl_rand.c +2 -32
- data/ext/openssl/ossl_ssl.c +347 -394
- data/ext/openssl/ossl_ssl_session.c +24 -29
- data/ext/openssl/ossl_ts.c +1539 -0
- data/ext/openssl/ossl_ts.h +16 -0
- data/ext/openssl/ossl_x509.c +0 -6
- data/ext/openssl/ossl_x509cert.c +169 -13
- data/ext/openssl/ossl_x509crl.c +13 -10
- data/ext/openssl/ossl_x509ext.c +15 -2
- data/ext/openssl/ossl_x509name.c +15 -4
- data/ext/openssl/ossl_x509req.c +13 -10
- data/ext/openssl/ossl_x509revoked.c +3 -3
- data/ext/openssl/ossl_x509store.c +154 -70
- data/lib/openssl/bn.rb +1 -1
- data/lib/openssl/buffering.rb +37 -5
- data/lib/openssl/cipher.rb +1 -1
- data/lib/openssl/digest.rb +10 -12
- data/lib/openssl/hmac.rb +78 -0
- data/lib/openssl/marshal.rb +30 -0
- data/lib/openssl/pkcs5.rb +1 -1
- data/lib/openssl/pkey.rb +443 -1
- data/lib/openssl/ssl.rb +47 -9
- data/lib/openssl/version.rb +5 -0
- data/lib/openssl/x509.rb +177 -1
- data/lib/openssl.rb +24 -9
- metadata +10 -79
- data/ext/openssl/deprecation.rb +0 -27
- data/ext/openssl/ossl_version.h +0 -15
- data/ext/openssl/ruby_missing.h +0 -24
- data/lib/openssl/config.rb +0 -492
data/ext/openssl/ossl_rand.c
CHANGED
@@ -120,36 +120,6 @@ ossl_rand_bytes(VALUE self, VALUE len)
|
|
120
120
|
return str;
|
121
121
|
}
|
122
122
|
|
123
|
-
#if defined(HAVE_RAND_PSEUDO_BYTES)
|
124
|
-
/*
|
125
|
-
* call-seq:
|
126
|
-
* pseudo_bytes(length) -> string
|
127
|
-
*
|
128
|
-
* Generates a String with _length_ number of pseudo-random bytes.
|
129
|
-
*
|
130
|
-
* Pseudo-random byte sequences generated by ::pseudo_bytes will be unique if
|
131
|
-
* they are of sufficient length, but are not necessarily unpredictable.
|
132
|
-
*
|
133
|
-
* === Example
|
134
|
-
*
|
135
|
-
* OpenSSL::Random.pseudo_bytes(12)
|
136
|
-
* #=> "..."
|
137
|
-
*/
|
138
|
-
static VALUE
|
139
|
-
ossl_rand_pseudo_bytes(VALUE self, VALUE len)
|
140
|
-
{
|
141
|
-
VALUE str;
|
142
|
-
int n = NUM2INT(len);
|
143
|
-
|
144
|
-
str = rb_str_new(0, n);
|
145
|
-
if (RAND_pseudo_bytes((unsigned char *)RSTRING_PTR(str), n) < 1) {
|
146
|
-
ossl_raise(eRandomError, NULL);
|
147
|
-
}
|
148
|
-
|
149
|
-
return str;
|
150
|
-
}
|
151
|
-
#endif
|
152
|
-
|
153
123
|
#ifdef HAVE_RAND_EGD
|
154
124
|
/*
|
155
125
|
* call-seq:
|
@@ -219,8 +189,8 @@ Init_ossl_rand(void)
|
|
219
189
|
rb_define_module_function(mRandom, "load_random_file", ossl_rand_load_file, 1);
|
220
190
|
rb_define_module_function(mRandom, "write_random_file", ossl_rand_write_file, 1);
|
221
191
|
rb_define_module_function(mRandom, "random_bytes", ossl_rand_bytes, 1);
|
222
|
-
#if defined(
|
223
|
-
|
192
|
+
#if OPENSSL_VERSION_NUMBER < 0x10101000 || defined(LIBRESSL_VERSION_NUMBER)
|
193
|
+
rb_define_alias(rb_singleton_class(mRandom), "pseudo_bytes", "random_bytes");
|
224
194
|
#endif
|
225
195
|
#ifdef HAVE_RAND_EGD
|
226
196
|
rb_define_module_function(mRandom, "egd", ossl_rand_egd, 1);
|