openssl 2.1.3 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +35 -45
  3. data/History.md +237 -1
  4. data/README.md +2 -2
  5. data/ext/openssl/extconf.rb +46 -38
  6. data/ext/openssl/openssl_missing.c +0 -66
  7. data/ext/openssl/openssl_missing.h +59 -43
  8. data/ext/openssl/ossl.c +110 -64
  9. data/ext/openssl/ossl.h +27 -10
  10. data/ext/openssl/ossl_asn1.c +41 -4
  11. data/ext/openssl/ossl_bn.c +251 -134
  12. data/ext/openssl/ossl_bn.h +2 -1
  13. data/ext/openssl/ossl_cipher.c +38 -29
  14. data/ext/openssl/ossl_config.c +412 -41
  15. data/ext/openssl/ossl_config.h +4 -7
  16. data/ext/openssl/ossl_digest.c +25 -60
  17. data/ext/openssl/ossl_engine.c +18 -27
  18. data/ext/openssl/ossl_hmac.c +60 -145
  19. data/ext/openssl/ossl_kdf.c +11 -19
  20. data/ext/openssl/ossl_ns_spki.c +1 -1
  21. data/ext/openssl/ossl_ocsp.c +9 -62
  22. data/ext/openssl/ossl_ocsp.h +3 -3
  23. data/ext/openssl/ossl_pkcs12.c +21 -3
  24. data/ext/openssl/ossl_pkcs7.c +45 -78
  25. data/ext/openssl/ossl_pkcs7.h +16 -0
  26. data/ext/openssl/ossl_pkey.c +1295 -178
  27. data/ext/openssl/ossl_pkey.h +35 -72
  28. data/ext/openssl/ossl_pkey_dh.c +124 -334
  29. data/ext/openssl/ossl_pkey_dsa.c +93 -398
  30. data/ext/openssl/ossl_pkey_ec.c +159 -318
  31. data/ext/openssl/ossl_pkey_rsa.c +105 -484
  32. data/ext/openssl/ossl_rand.c +2 -32
  33. data/ext/openssl/ossl_ssl.c +347 -394
  34. data/ext/openssl/ossl_ssl_session.c +24 -29
  35. data/ext/openssl/ossl_ts.c +1539 -0
  36. data/ext/openssl/ossl_ts.h +16 -0
  37. data/ext/openssl/ossl_x509.c +0 -6
  38. data/ext/openssl/ossl_x509cert.c +169 -13
  39. data/ext/openssl/ossl_x509crl.c +13 -10
  40. data/ext/openssl/ossl_x509ext.c +15 -2
  41. data/ext/openssl/ossl_x509name.c +15 -4
  42. data/ext/openssl/ossl_x509req.c +13 -10
  43. data/ext/openssl/ossl_x509revoked.c +3 -3
  44. data/ext/openssl/ossl_x509store.c +154 -70
  45. data/lib/openssl/bn.rb +1 -1
  46. data/lib/openssl/buffering.rb +37 -5
  47. data/lib/openssl/cipher.rb +1 -1
  48. data/lib/openssl/digest.rb +10 -12
  49. data/lib/openssl/hmac.rb +78 -0
  50. data/lib/openssl/marshal.rb +30 -0
  51. data/lib/openssl/pkcs5.rb +1 -1
  52. data/lib/openssl/pkey.rb +443 -1
  53. data/lib/openssl/ssl.rb +47 -9
  54. data/lib/openssl/version.rb +5 -0
  55. data/lib/openssl/x509.rb +177 -1
  56. data/lib/openssl.rb +24 -9
  57. metadata +10 -79
  58. data/ext/openssl/deprecation.rb +0 -27
  59. data/ext/openssl/ossl_version.h +0 -15
  60. data/ext/openssl/ruby_missing.h +0 -24
  61. data/lib/openssl/config.rb +0 -492
@@ -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(HAVE_RAND_PSEUDO_BYTES)
223
- rb_define_module_function(mRandom, "pseudo_bytes", ossl_rand_pseudo_bytes, 1);
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);