jruby-openssl 0.9.20-java → 0.10.7-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +132 -1
  3. data/LICENSE.txt +1 -1
  4. data/Mavenfile +49 -69
  5. data/README.md +14 -16
  6. data/Rakefile +4 -0
  7. data/lib/jopenssl/_compat23.rb +71 -0
  8. data/lib/jopenssl/load.rb +21 -12
  9. data/lib/jopenssl/version.rb +8 -10
  10. data/lib/jopenssl.jar +0 -0
  11. data/lib/jopenssl19/openssl/ssl-internal.rb +104 -0
  12. data/lib/jopenssl22/openssl/ssl.rb +16 -16
  13. data/lib/jopenssl23/openssl/bn.rb +2 -1
  14. data/lib/jopenssl23/openssl/buffering.rb +39 -35
  15. data/lib/jopenssl23/openssl/config.rb +12 -11
  16. data/lib/jopenssl23/openssl/digest.rb +1 -1
  17. data/lib/jopenssl23/openssl/pkey.rb +22 -34
  18. data/lib/jopenssl23/openssl/ssl.rb +210 -125
  19. data/lib/jopenssl23/openssl/x509.rb +76 -1
  20. data/lib/jopenssl23/openssl.rb +1 -1
  21. data/lib/openssl/bn.rb +1 -3
  22. data/lib/openssl/buffering.rb +1 -3
  23. data/lib/openssl/cipher.rb +1 -3
  24. data/lib/openssl/config.rb +10 -4
  25. data/lib/openssl/digest.rb +1 -3
  26. data/lib/openssl/pkcs12.rb +1 -3
  27. data/lib/openssl/pkcs5.rb +22 -0
  28. data/lib/openssl/ssl-internal.rb +1 -3
  29. data/lib/openssl/ssl.rb +1 -3
  30. data/lib/openssl/x509-internal.rb +1 -3
  31. data/lib/openssl/x509.rb +1 -3
  32. data/lib/org/bouncycastle/bcpkix-jdk15on/1.68/bcpkix-jdk15on-1.68.jar +0 -0
  33. data/lib/org/bouncycastle/bcprov-jdk15on/1.68/bcprov-jdk15on-1.68.jar +0 -0
  34. data/lib/org/bouncycastle/bctls-jdk15on/1.68/bctls-jdk15on-1.68.jar +0 -0
  35. data/pom.xml +100 -322
  36. metadata +19 -75
  37. data/integration/1.47/pom.xml +0 -15
  38. data/integration/1.48/pom.xml +0 -15
  39. data/integration/1.49/pom.xml +0 -15
  40. data/integration/1.50/pom.xml +0 -15
  41. data/integration/Mavenfile +0 -57
  42. data/integration/pom.xml +0 -122
  43. data/lib/jopenssl18/openssl/bn.rb +0 -25
  44. data/lib/jopenssl18/openssl/buffering.rb +0 -241
  45. data/lib/jopenssl18/openssl/cipher.rb +0 -28
  46. data/lib/jopenssl18/openssl/config.rb +0 -316
  47. data/lib/jopenssl18/openssl/digest.rb +0 -32
  48. data/lib/jopenssl18/openssl/pkcs7.rb +0 -25
  49. data/lib/jopenssl18/openssl/ssl-internal.rb +0 -112
  50. data/lib/jopenssl18/openssl/ssl.rb +0 -1
  51. data/lib/jopenssl18/openssl/x509-internal.rb +0 -110
  52. data/lib/jopenssl18/openssl/x509.rb +0 -1
  53. data/lib/jopenssl18/openssl.rb +0 -23
  54. data/lib/jopenssl24.rb +0 -112
  55. data/lib/openssl/pkcs7.rb +0 -5
  56. data/lib/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.jar +0 -0
  57. data/lib/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar +0 -0
metadata CHANGED
@@ -1,60 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby-openssl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.20
4
+ version: 0.10.7
5
5
  platform: java
6
6
  authors:
7
+ - Karol Bucek
7
8
  - Ola Bini
8
9
  - JRuby contributors
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2017-03-02 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '0.1'
20
- name: jar-dependencies
21
- prerelease: false
22
- type: :development
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ~>
26
- - !ruby/object:Gem::Version
27
- version: '0.1'
28
- - !ruby/object:Gem::Dependency
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ~>
32
- - !ruby/object:Gem::Version
33
- version: 1.1.0
34
- name: mocha
35
- prerelease: false
36
- type: :development
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ~>
40
- - !ruby/object:Gem::Version
41
- version: 1.1.0
42
- - !ruby/object:Gem::Dependency
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ~>
46
- - !ruby/object:Gem::Version
47
- version: '3.0'
48
- name: ruby-maven
49
- prerelease: false
50
- type: :development
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ~>
54
- - !ruby/object:Gem::Version
55
- version: '3.0'
13
+ date: 2021-04-28 00:00:00.000000000 Z
14
+ dependencies: []
56
15
  description: JRuby-OpenSSL is an add-on gem for JRuby that emulates the Ruby OpenSSL native library.
57
- email: ola.bini@gmail.com
16
+ email: self+jruby-openssl@kares.org
58
17
  executables: []
59
18
  extensions: []
60
19
  extra_rdoc_files: []
@@ -64,25 +23,10 @@ files:
64
23
  - Mavenfile
65
24
  - README.md
66
25
  - Rakefile
67
- - integration/1.47/pom.xml
68
- - integration/1.48/pom.xml
69
- - integration/1.49/pom.xml
70
- - integration/1.50/pom.xml
71
- - integration/Mavenfile
72
- - integration/pom.xml
26
+ - lib/jopenssl.jar
27
+ - lib/jopenssl/_compat23.rb
73
28
  - lib/jopenssl/load.rb
74
29
  - lib/jopenssl/version.rb
75
- - lib/jopenssl18/openssl.rb
76
- - lib/jopenssl18/openssl/bn.rb
77
- - lib/jopenssl18/openssl/buffering.rb
78
- - lib/jopenssl18/openssl/cipher.rb
79
- - lib/jopenssl18/openssl/config.rb
80
- - lib/jopenssl18/openssl/digest.rb
81
- - lib/jopenssl18/openssl/pkcs7.rb
82
- - lib/jopenssl18/openssl/ssl-internal.rb
83
- - lib/jopenssl18/openssl/ssl.rb
84
- - lib/jopenssl18/openssl/x509-internal.rb
85
- - lib/jopenssl18/openssl/x509.rb
86
30
  - lib/jopenssl19/openssl.rb
87
31
  - lib/jopenssl19/openssl/bn.rb
88
32
  - lib/jopenssl19/openssl/buffering.rb
@@ -118,7 +62,6 @@ files:
118
62
  - lib/jopenssl23/openssl/pkey.rb
119
63
  - lib/jopenssl23/openssl/ssl.rb
120
64
  - lib/jopenssl23/openssl/x509.rb
121
- - lib/jopenssl24.rb
122
65
  - lib/jruby-openssl.rb
123
66
  - lib/openssl.rb
124
67
  - lib/openssl/bn.rb
@@ -127,16 +70,16 @@ files:
127
70
  - lib/openssl/config.rb
128
71
  - lib/openssl/digest.rb
129
72
  - lib/openssl/pkcs12.rb
130
- - lib/openssl/pkcs7.rb
73
+ - lib/openssl/pkcs5.rb
131
74
  - lib/openssl/pkey.rb
132
75
  - lib/openssl/ssl-internal.rb
133
76
  - lib/openssl/ssl.rb
134
77
  - lib/openssl/x509-internal.rb
135
78
  - lib/openssl/x509.rb
79
+ - lib/org/bouncycastle/bcpkix-jdk15on/1.68/bcpkix-jdk15on-1.68.jar
80
+ - lib/org/bouncycastle/bcprov-jdk15on/1.68/bcprov-jdk15on-1.68.jar
81
+ - lib/org/bouncycastle/bctls-jdk15on/1.68/bctls-jdk15on-1.68.jar
136
82
  - pom.xml
137
- - lib/jopenssl.jar
138
- - lib/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.jar
139
- - lib/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar
140
83
  homepage: https://github.com/jruby/jruby-openssl
141
84
  licenses:
142
85
  - EPL-1.0
@@ -149,19 +92,20 @@ require_paths:
149
92
  - lib
150
93
  required_ruby_version: !ruby/object:Gem::Requirement
151
94
  requirements:
152
- - - '>='
95
+ - - ">="
153
96
  - !ruby/object:Gem::Version
154
- version: '0'
97
+ version: 1.9.3
155
98
  required_rubygems_version: !ruby/object:Gem::Requirement
156
99
  requirements:
157
- - - '>='
100
+ - - ">="
158
101
  - !ruby/object:Gem::Version
159
- version: '0'
102
+ version: 2.4.8
160
103
  requirements:
161
- - jar org.bouncycastle:bcpkix-jdk15on, 1.56
162
- - jar org.bouncycastle:bcprov-jdk15on, 1.56
104
+ - jar org.bouncycastle:bcprov-jdk15on, 1.68
105
+ - jar org.bouncycastle:bcpkix-jdk15on, 1.68
106
+ - jar org.bouncycastle:bctls-jdk15on, 1.68
163
107
  rubyforge_project:
164
- rubygems_version: 2.1.9
108
+ rubygems_version: 2.6.14.1
165
109
  signing_key:
166
110
  specification_version: 4
167
111
  summary: JRuby OpenSSL
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4
- <modelVersion>4.0.0</modelVersion>
5
- <parent>
6
- <groupId>none</groupId>
7
- <artifactId>base</artifactId>
8
- <version>0</version>
9
- </parent>
10
- <artifactId>bouncy-castle</artifactId>
11
- <version>1.47</version>
12
- <properties>
13
- <bc.version>${project.version}</bc.version>
14
- </properties>
15
- </project>
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4
- <modelVersion>4.0.0</modelVersion>
5
- <parent>
6
- <groupId>none</groupId>
7
- <artifactId>base</artifactId>
8
- <version>0</version>
9
- </parent>
10
- <artifactId>bouncy-castle</artifactId>
11
- <version>1.48</version>
12
- <properties>
13
- <bc.version>${project.version}</bc.version>
14
- </properties>
15
- </project>
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4
- <modelVersion>4.0.0</modelVersion>
5
- <parent>
6
- <groupId>none</groupId>
7
- <artifactId>base</artifactId>
8
- <version>0</version>
9
- </parent>
10
- <artifactId>bouncy-castle</artifactId>
11
- <version>1.49</version>
12
- <properties>
13
- <bc.version>${project.version}</bc.version>
14
- </properties>
15
- </project>
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4
- <modelVersion>4.0.0</modelVersion>
5
- <parent>
6
- <groupId>none</groupId>
7
- <artifactId>base</artifactId>
8
- <version>0</version>
9
- </parent>
10
- <artifactId>bouncy-castle</artifactId>
11
- <version>1.50</version>
12
- <properties>
13
- <bc.version>${project.version}</bc.version>
14
- </properties>
15
- </project>
@@ -1,57 +0,0 @@
1
- #-*- mode: ruby -*-
2
-
3
- id 'none:base:0'
4
- packaging :pom
5
-
6
- snapshot_repository :id => 'jruby', :url => 'http://ci.jruby.org/snapshots/maven'
7
-
8
- # TODO should be setup whenever a plugin uses gems
9
- plugin_repository :id => 'rubygems-releases', :url => 'http://rubygems-proxy.torquebox.org/releases'
10
-
11
- base_path = File.expand_path('..', File.dirname(__FILE__))
12
- bc_version = File.read("#{base_path}/lib/jopenssl/version.rb")[/BOUNCY_CASTLE_VERSION\s?=\s?'(.*?)'/, 1]
13
-
14
- properties( 'bc.version' => bc_version, # to satisfy maven
15
- 'jruby.openssl.version' => '0.9.7', # to satisfy maven
16
- # use the gem-maven-plugin repo for the tests
17
- 'gem.home' => '${basedir}/../pkg/rubygems',
18
- 'gem.path' => '${basedir}/../pkg/rubygems',
19
- 'tesla.dump.pom' => 'pom.xml',
20
- 'tesla.dump.readonly' => true,
21
- 'jruby.version' => '1.7.19', # for jruby-maven-plugins
22
- 'jruby.plugins.version' => '1.0.9' )
23
-
24
- jruby_plugin :gem, :gemHomes => { 'gem-maven-plugin' => '${gem.home}' } do
25
- execute_goal :initialize
26
-
27
- gem 'jar-dependencies', '0.1.8' # TODO change after 0.1.15 is out
28
- spec = Gem::Specification.load "#{base_path}/jruby-openssl.gemspec"
29
- spec.development_dependencies.each do |dev_spec|
30
- gem dev_spec.name, *dev_spec.requirements_list
31
- end
32
-
33
- # make sure we have those in the local repo
34
- # BUT not be part of the runit-classloader
35
- # otherwise jruby-1.7.x and jruby-1.6.x will not use those
36
- # required in the test_*.rb files
37
- jar 'org.bouncycastle', 'bcpkix-jdk15on', '${bc.version}'
38
- jar 'org.bouncycastle', 'bcprov-jdk15on', '${bc.version}'
39
- #spec.requirements.each do |req|
40
- # req = req.sub('jar', '').split(',').each(&:strip!)
41
- # jar req[0], req[1]
42
- #end
43
-
44
- gem 'jruby-openssl', '${jruby.openssl.version}'
45
-
46
- end
47
-
48
- jruby_plugin :runit do
49
- execute_goal( :test,
50
- :env => { 'BC_VERSION' => '${bc.version}' },
51
- :jrubySwitches => '-I../../lib',
52
- :runitDirectory => '../../src/test/ruby/**/test_*.rb',
53
- :versions => '${jruby.versions}',
54
- :modes => '${jruby.modes}' )
55
- end
56
-
57
- # vim: syntax=Ruby
data/integration/pom.xml DELETED
@@ -1,122 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4
- <modelVersion>4.0.0</modelVersion>
5
- <groupId>none</groupId>
6
- <artifactId>base</artifactId>
7
- <version>0</version>
8
- <packaging>pom</packaging>
9
- <name>integration</name>
10
- <properties>
11
- <jruby.version>1.7.19</jruby.version>
12
- <tesla.dump.readonly>true</tesla.dump.readonly>
13
- <jruby.openssl.version>0.9.7</jruby.openssl.version>
14
- <gem.path>${basedir}/../pkg/rubygems</gem.path>
15
- <jruby.plugins.version>1.0.9</jruby.plugins.version>
16
- <gem.home>${basedir}/../pkg/rubygems</gem.home>
17
- <bc.version>1.50</bc.version>
18
- <tesla.dump.pom>pom.xml</tesla.dump.pom>
19
- </properties>
20
- <repositories>
21
- <repository>
22
- <releases>
23
- <enabled>false</enabled>
24
- </releases>
25
- <snapshots>
26
- <enabled>true</enabled>
27
- </snapshots>
28
- <id>jruby</id>
29
- <url>http://ci.jruby.org/snapshots/maven</url>
30
- </repository>
31
- </repositories>
32
- <pluginRepositories>
33
- <pluginRepository>
34
- <id>rubygems-releases</id>
35
- <url>http://rubygems-proxy.torquebox.org/releases</url>
36
- </pluginRepository>
37
- </pluginRepositories>
38
- <build>
39
- <plugins>
40
- <plugin>
41
- <groupId>de.saumya.mojo</groupId>
42
- <artifactId>gem-maven-plugin</artifactId>
43
- <version>${jruby.plugins.version}</version>
44
- <executions>
45
- <execution>
46
- <goals>
47
- <goal>initialize</goal>
48
- </goals>
49
- </execution>
50
- </executions>
51
- <dependencies>
52
- <dependency>
53
- <groupId>rubygems</groupId>
54
- <artifactId>jar-dependencies</artifactId>
55
- <version>0.1.8</version>
56
- <type>gem</type>
57
- </dependency>
58
- <dependency>
59
- <groupId>rubygems</groupId>
60
- <artifactId>jar-dependencies</artifactId>
61
- <version>[0.1.0,0.1.99999]</version>
62
- <type>gem</type>
63
- </dependency>
64
- <dependency>
65
- <groupId>rubygems</groupId>
66
- <artifactId>mocha</artifactId>
67
- <version>[1.1.0,1.1.99999]</version>
68
- <type>gem</type>
69
- </dependency>
70
- <dependency>
71
- <groupId>rubygems</groupId>
72
- <artifactId>ruby-maven</artifactId>
73
- <version>[0,)</version>
74
- <type>gem</type>
75
- </dependency>
76
- <dependency>
77
- <groupId>org.bouncycastle</groupId>
78
- <artifactId>bcpkix-jdk15on</artifactId>
79
- <version>${bc.version}</version>
80
- </dependency>
81
- <dependency>
82
- <groupId>org.bouncycastle</groupId>
83
- <artifactId>bcprov-jdk15on</artifactId>
84
- <version>${bc.version}</version>
85
- </dependency>
86
- <dependency>
87
- <groupId>rubygems</groupId>
88
- <artifactId>jruby-openssl</artifactId>
89
- <version>${jruby.openssl.version}</version>
90
- <type>gem</type>
91
- </dependency>
92
- </dependencies>
93
- <configuration>
94
- <gemHomes>
95
- <gem-maven-plugin>${gem.home}</gem-maven-plugin>
96
- </gemHomes>
97
- </configuration>
98
- </plugin>
99
- <plugin>
100
- <groupId>de.saumya.mojo</groupId>
101
- <artifactId>runit-maven-plugin</artifactId>
102
- <version>${jruby.plugins.version}</version>
103
- <executions>
104
- <execution>
105
- <goals>
106
- <goal>test</goal>
107
- </goals>
108
- <configuration>
109
- <env>
110
- <BC_VERSION>${bc.version}</BC_VERSION>
111
- </env>
112
- <jrubySwitches>-I../../lib</jrubySwitches>
113
- <runitDirectory>../../src/test/ruby/**/test_*.rb</runitDirectory>
114
- <versions>${jruby.versions}</versions>
115
- <modes>${jruby.modes}</modes>
116
- </configuration>
117
- </execution>
118
- </executions>
119
- </plugin>
120
- </plugins>
121
- </build>
122
- </project>
@@ -1,25 +0,0 @@
1
- =begin
2
- = $RCSfile$ -- Ruby-space definitions that completes C-space funcs for BN
3
-
4
- = Info
5
- 'OpenSSL for Ruby 2' project
6
- Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
7
- All rights reserved.
8
-
9
- = Licence
10
- This program is licenced under the same licence as Ruby.
11
- (See the file 'LICENCE'.)
12
-
13
- = Version
14
- $Id$
15
- =end
16
-
17
- ##
18
- # Add double dispatch to Integer
19
- #
20
- class Integer
21
- def to_bn
22
- OpenSSL::BN::new(self.to_s(16), 16)
23
- end
24
- end # Integer
25
-
@@ -1,241 +0,0 @@
1
- =begin
2
- = $RCSfile$ -- Buffering mix-in module.
3
-
4
- = Info
5
- 'OpenSSL for Ruby 2' project
6
- Copyright (C) 2001 GOTOU YUUZOU <gotoyuzo@notwork.org>
7
- All rights reserved.
8
-
9
- = Licence
10
- This program is licenced under the same licence as Ruby.
11
- (See the file 'LICENCE'.)
12
-
13
- = Version
14
- $Id$
15
- =end
16
-
17
- module OpenSSL
18
- module Buffering
19
- include Enumerable
20
- attr_accessor :sync
21
- BLOCK_SIZE = 1024*16
22
-
23
- def initialize(*args)
24
- @eof = false
25
- @rbuffer = ""
26
- @sync = @io.sync
27
- end
28
-
29
- #
30
- # for reading.
31
- #
32
- private
33
-
34
- def fill_rbuff
35
- begin
36
- @rbuffer << self.sysread(BLOCK_SIZE)
37
- rescue Errno::EAGAIN
38
- retry
39
- rescue EOFError
40
- @eof = true
41
- end
42
- end
43
-
44
- def consume_rbuff(size=nil)
45
- if @rbuffer.empty?
46
- nil
47
- else
48
- size = @rbuffer.size unless size
49
- ret = @rbuffer[0, size]
50
- @rbuffer[0, size] = ""
51
- ret
52
- end
53
- end
54
-
55
- public
56
-
57
- def read(size=nil, buf=nil)
58
- if size == 0
59
- if buf
60
- buf.clear
61
- else
62
- buf = ""
63
- end
64
- return @eof ? nil : buf
65
- end
66
- until @eof
67
- break if size && size <= @rbuffer.size
68
- fill_rbuff
69
- end
70
- ret = consume_rbuff(size) || ""
71
- if buf
72
- buf.replace(ret)
73
- ret = buf
74
- end
75
- (size && ret.empty?) ? nil : ret
76
- end
77
-
78
- def readpartial(maxlen, buf=nil)
79
- if maxlen == 0
80
- if buf
81
- buf.clear
82
- else
83
- buf = ""
84
- end
85
- return @eof ? nil : buf
86
- end
87
- if @rbuffer.empty?
88
- begin
89
- return sysread(maxlen, buf)
90
- rescue Errno::EAGAIN
91
- retry
92
- end
93
- end
94
- ret = consume_rbuff(maxlen)
95
- if buf
96
- buf.replace(ret)
97
- ret = buf
98
- end
99
- raise EOFError if ret.empty?
100
- ret
101
- end
102
-
103
- def gets(eol=$/)
104
- idx = @rbuffer.index(eol)
105
- until @eof
106
- break if idx
107
- fill_rbuff
108
- idx = @rbuffer.index(eol)
109
- end
110
- if eol.is_a?(Regexp)
111
- size = idx ? idx+$&.size : nil
112
- else
113
- size = idx ? idx+eol.size : nil
114
- end
115
- consume_rbuff(size)
116
- end
117
-
118
- def each(eol=$/)
119
- while line = self.gets(eol)
120
- yield line
121
- end
122
- end
123
- alias each_line each
124
-
125
- def readlines(eol=$/)
126
- ary = []
127
- while line = self.gets(eol)
128
- ary << line
129
- end
130
- ary
131
- end
132
-
133
- def readline(eol=$/)
134
- raise EOFError if eof?
135
- gets(eol)
136
- end
137
-
138
- def getc
139
- c = read(1)
140
- c ? c[0] : nil
141
- end
142
-
143
- def each_byte
144
- while c = getc
145
- yield(c)
146
- end
147
- end
148
-
149
- def readchar
150
- raise EOFError if eof?
151
- getc
152
- end
153
-
154
- def ungetc(c)
155
- @rbuffer[0,0] = c.chr
156
- end
157
-
158
- def eof?
159
- fill_rbuff if !@eof && @rbuffer.empty?
160
- @eof && @rbuffer.empty?
161
- end
162
- alias eof eof?
163
-
164
- #
165
- # for writing.
166
- #
167
- private
168
-
169
- def do_write(s)
170
- @wbuffer = "" unless defined? @wbuffer
171
- @wbuffer << s
172
- @sync ||= false
173
- if @sync or @wbuffer.size > BLOCK_SIZE or idx = @wbuffer.rindex($/)
174
- remain = idx ? idx + $/.size : @wbuffer.length
175
- nwritten = 0
176
- while remain > 0
177
- str = @wbuffer[nwritten,remain]
178
- begin
179
- nwrote = syswrite(str)
180
- rescue Errno::EAGAIN
181
- retry
182
- end
183
- remain -= nwrote
184
- nwritten += nwrote
185
- end
186
- @wbuffer[0,nwritten] = ""
187
- end
188
- end
189
-
190
- public
191
-
192
- def write(s)
193
- do_write(s)
194
- s.length
195
- end
196
-
197
- def << (s)
198
- do_write(s)
199
- self
200
- end
201
-
202
- def puts(*args)
203
- s = ""
204
- if args.empty?
205
- s << "\n"
206
- end
207
- args.each{|arg|
208
- s << arg.to_s
209
- if $/ && /\n\z/ !~ s
210
- s << "\n"
211
- end
212
- }
213
- do_write(s)
214
- nil
215
- end
216
-
217
- def print(*args)
218
- s = ""
219
- args.each{ |arg| s << arg.to_s }
220
- do_write(s)
221
- nil
222
- end
223
-
224
- def printf(s, *args)
225
- do_write(s % args)
226
- nil
227
- end
228
-
229
- def flush
230
- osync = @sync
231
- @sync = true
232
- do_write ""
233
- @sync = osync
234
- end
235
-
236
- def close
237
- flush rescue nil
238
- sysclose
239
- end
240
- end
241
- end
@@ -1,28 +0,0 @@
1
- =begin
2
- = $RCSfile$ -- Ruby-space predefined Cipher subclasses
3
-
4
- = Info
5
- 'OpenSSL for Ruby 2' project
6
- Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
7
- All rights reserved.
8
-
9
- = Licence
10
- This program is licenced under the same licence as Ruby.
11
- (See the file 'LICENCE'.)
12
-
13
- = Version
14
- $Id$
15
- =end
16
-
17
- ##
18
- # Should we care what if somebody require this file directly?
19
- #require 'openssl'
20
-
21
- module OpenSSL
22
- class Cipher
23
- # This class is only provided for backwards compatibility. Use OpenSSL::Digest in the future.
24
- class Cipher < Cipher
25
- # add warning
26
- end
27
- end # Cipher
28
- end # OpenSSL