jruby-openssl 0.10.0-java → 0.10.1-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,112 +0,0 @@
1
- # frozen_string_literal: false
2
-
3
- # Ruby 2.4 preliminary compatibility script, loaded after all (2.3) jruby-openssl files
4
-
5
- module OpenSSL
6
-
7
- module SSL
8
- class SSLContext
9
- # OpenSSL 1.1.0 introduced "security level"
10
- def security_level; 0 end
11
- def security_level=(level); raise NotImplementedError end
12
- end
13
- end
14
-
15
- module PKey
16
-
17
- class DH
18
-
19
- def set_key(pub_key, priv_key)
20
- self.public_key = pub_key
21
- self.priv_key = priv_key
22
- self
23
- end
24
-
25
- def set_pqg(p, q, g)
26
- self.p = p
27
- # TODO self.q = q
28
- if respond_to?(:q)
29
- self.q = q
30
- else
31
- OpenSSL.warn "JRuby-OpenSSL does not support setting q param on #{inspect}" if q
32
- end
33
- self.g = g
34
- self
35
- end
36
-
37
- end
38
-
39
- class DSA
40
-
41
- def set_key(pub_key, priv_key)
42
- self.public_key = pub_key
43
- self.priv_key = priv_key
44
- self
45
- end
46
-
47
- def set_pqg(p, q, g)
48
- self.p = p
49
- self.q = q
50
- self.g = g
51
- self
52
- end
53
-
54
- end
55
-
56
- class RSA
57
-
58
- def set_key(n, e, d)
59
- self.n = n
60
- self.e = e
61
- self.d = d
62
- self
63
- end
64
-
65
- def set_factors(p, q)
66
- self.p = p
67
- self.q = q
68
- self
69
- end
70
-
71
- def set_crt_params(dmp1, dmq1, iqmp)
72
- self.dmp1 = dmp1
73
- self.dmq1 = dmq1
74
- self.iqmp = iqmp
75
- self
76
- end
77
-
78
- end
79
-
80
- # openssl/lib/openssl/pkey.rb :
81
-
82
- class DH
83
-
84
- remove_const :DEFAULT_512 if const_defined?(:DEFAULT_512)
85
-
86
- DEFAULT_2048 = new <<-_end_of_pem_
87
- -----BEGIN DH PARAMETERS-----
88
- MIIBCAKCAQEA7E6kBrYiyvmKAMzQ7i8WvwVk9Y/+f8S7sCTN712KkK3cqd1jhJDY
89
- JbrYeNV3kUIKhPxWHhObHKpD1R84UpL+s2b55+iMd6GmL7OYmNIT/FccKhTcveab
90
- VBmZT86BZKYyf45hUF9FOuUM9xPzuK3Vd8oJQvfYMCd7LPC0taAEljQLR4Edf8E6
91
- YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
92
- 1bNveX5wInh5GDx1FGhKBZ+s1H+aedudCm7sCgRwv8lKWYGiHzObSma8A86KG+MD
93
- 7Lo5JquQ3DlBodj3IDyPrxIv96lvRPFtAwIBAg==
94
- -----END DH PARAMETERS-----
95
- _end_of_pem_
96
-
97
- end
98
-
99
- remove_const :DEFAULT_TMP_DH_CALLBACK if const_defined?(:DEFAULT_TMP_DH_CALLBACK)
100
-
101
- DEFAULT_TMP_DH_CALLBACK = lambda { |ctx, is_export, keylen|
102
- warn "using default DH parameters." if $VERBOSE
103
- case keylen
104
- when 1024 then OpenSSL::PKey::DH::DEFAULT_1024
105
- when 2048 then OpenSSL::PKey::DH::DEFAULT_2048
106
- else nil
107
- end
108
- }
109
-
110
- end
111
-
112
- end
@@ -1,5 +0,0 @@
1
- if RUBY_VERSION > '1.9'
2
- raise LoadError, "no such library in #{RUBY_VERSION}: openssl/pkcs7"
3
- else
4
- load "jopenssl18/openssl/pkcs7.rb"
5
- end