costan-tem_openssl 0.3.6

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.
data/CHANGELOG ADDED
@@ -0,0 +1,19 @@
1
+ v0.3.6. Updated to the API of tem_ruby 0.10.2.
2
+
3
+ v0.3.5. Updated to the API of tem_ruby 0.10.1.
4
+
5
+ v0.3.4. Updated to the API of tem_ruby 0.10.0.
6
+
7
+ v0.3.3. Updated to the API of tem_ruby 0.9.1.
8
+
9
+ v0.3.2. Updated to the API of tem_ruby 0.7.1 (Tem#pubek instead of an ugly hack).
10
+
11
+ v0.3.1. Updated to the API of tem_ruby 0.7.0.
12
+
13
+ v0.3. Implemented rsautl -sign and -verify to meet the openssl specs.
14
+
15
+ v0.2.1. Implemented public key exporting to PEM files. Requires public keys instead of the full key when possible. The TEM should not be needed when only public keys are required.
16
+
17
+ v0.2. Implemented signing.
18
+
19
+ v0.1. Initial release.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2007 Massachusetts Institute of Technology
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/Manifest ADDED
@@ -0,0 +1,11 @@
1
+ bin/openssl_tem
2
+ CHANGELOG
3
+ lib/openssl/executor.rb
4
+ lib/openssl/key.rb
5
+ lib/openssl/tem_tools.rb
6
+ lib/tem_openssl.rb
7
+ LICENSE
8
+ Manifest
9
+ Rakefile
10
+ README
11
+ test/test_executor.rb
data/README ADDED
@@ -0,0 +1,37 @@
1
+ This is a tool for the TEM-based OpenSSL engine.
2
+
3
+ Running coverage tests:
4
+ gem install rcov
5
+ rcov -Ilib test/*.rb
6
+
7
+ Implemented commands (the format is supposed to be compatible with the "openssl"
8
+ tool):
9
+
10
+ openssl_tem reset
11
+ Resets the TEM to a working state. The TEM applet is reinitialized, and the TEM
12
+ is emitted. All key material and state on TEM is lost.
13
+
14
+ openssl_tem rsagen 2048 -out key.temkey
15
+ Generates a RSA key pair on the TEM (the size is ignored), outputs the TEM-bound
16
+ key pair to "key.temkey".
17
+
18
+ openssl_tem rsa -in key.temkey -out key.pem -pubout
19
+ Extracts the public key from a TEM-bound key pair, outputs it in PEM format to
20
+ "key.pem"
21
+
22
+ openssl_tem rsautl -encrypt -in plain.txt -inkey key.pem -out crypted.txt -pkcs
23
+ Encrypts the data in "plain.txt" using the PEM public key (or public key in a
24
+ TEM-bound key pair) in "key.pem". PKCS#1 padding is always used.
25
+
26
+ openssl_tem rsautl -decrypt -in crypted.txt -inkey key.temkey -out plain2.txt -pkcs
27
+ Decrypts the data in "crypted.txt" using TEM-bound key pair in "key.temkey".
28
+ PKCS#1 padding is always used.
29
+
30
+ openssl_tem rsautl -xsign -in plain.txt -inkey key.temkey -out signature.txt -pkcs
31
+ Signs the data in "plain.txt" using the TEM-bound key pair in "key.temkey".
32
+ PKCS#1 padding over a SHA-1 message digest of the data is always used.
33
+
34
+ openssl_tem rsautl -xverify -in signature.txt -inkey key.pem -indata plain.txt -out verif.txt -pkcs
35
+ Verifies that "signature.txt" was produced by signing the data in "plain.txt"
36
+ using the TEM-bound key with the PEM public key in "key.pem". PKCS#1 padding
37
+ over a SHA-1 of the data is always used. The output is "true" or "false".
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ require 'rubygems'
2
+ gem 'echoe'
3
+ require 'echoe'
4
+
5
+ Echoe.new('tem_openssl') do |p|
6
+ p.project = 'tem' # rubyforge project
7
+
8
+ p.author = 'Victor Costan'
9
+ p.email = 'victor@costan.us'
10
+ p.summary = 'TEM (Trusted Execution Module) engine for OpenSSL.'
11
+ p.url = 'http://tem.rubyforge.org'
12
+ p.dependencies = ['tem_ruby >=0.10.2']
13
+
14
+ p.need_tar_gz = !Platform.windows?
15
+ p.need_zip = !Platform.windows?
16
+ p.rdoc_pattern = /^(lib|bin|tasks|ext)|^BUILD|^README|^CHANGELOG|^TODO|^LICENSE|^COPYING$/
17
+ end
18
+
19
+ if $0 == __FILE__
20
+ Rake.application = Rake::Application.new
21
+ Rake.application.run
22
+ end
data/bin/openssl_tem ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'tem_openssl'
5
+
6
+ Tem::OpenSSL::Executor.run(ARGV)
@@ -0,0 +1,110 @@
1
+ # :nodoc: namespace
2
+ module Tem::OpenSSL
3
+
4
+ class Executor
5
+ def initialize(args, test_options)
6
+ @args = args
7
+ # unknown args get thrown here
8
+ @arg_bag = {}
9
+ # read key from here
10
+ @in_key = nil
11
+ # read (original) data from here
12
+ @in_data = nil
13
+ # read input from here
14
+ @in = $stdin
15
+ # dump output here
16
+ @out = $stdout
17
+ # run the procs here to clean up
18
+ @cleanup_procs = []
19
+
20
+ # hash of flags to help unit tests
21
+ @test_options = test_options
22
+
23
+ connect_to_tem
24
+ parse_args
25
+ end
26
+
27
+ def run
28
+ case @args[0]
29
+ when 'reset'
30
+ @tem.kill
31
+ @tem.activate
32
+ @tem.emit
33
+ when 'rsa'
34
+ if @arg_bag[:pubout]
35
+ @key = Tem::OpenSSL::Key.load_from_tkfile @in
36
+ @out.write @key.pub_key.ssl_key.to_s
37
+ end
38
+ when 'rsagen'
39
+ @key = Tem::OpenSSL::Key.new_tem_key @tem
40
+ @out.write @key.to_tkfile
41
+ when 'rsautl'
42
+ @key = Tem::OpenSSL::Key.load_from_tkfile @in_key
43
+ data = @in.read
44
+ case
45
+ when @arg_bag[:decrypt]
46
+ # decrypting with private key
47
+ result = @key.privk_decrypt data, @tem
48
+ when @arg_bag[:encrypt]
49
+ # encrypting with public key
50
+ result = @key.pub_key.encrypt data
51
+ when @arg_bag[:sign]
52
+ # fake-signing (encrypting with private key)
53
+ result = @key.privk_encrypt data, @tem
54
+ when @arg_bag[:verify]
55
+ # fake-verifying (decrypting with public key)
56
+ result = @key.pub_key.decrypt data
57
+ when @arg_bag[:xsign]
58
+ result = @key.privk_sign data, @tem
59
+ when @arg_bag[:xverify]
60
+ orig_data = @in_data.read
61
+ result = @key.pub_key.verify orig_data, data
62
+ else
63
+ # ?!
64
+ end
65
+ @out.write result
66
+ end
67
+ end
68
+
69
+ def parse_args
70
+ 0.upto(@args.length - 1) do |i|
71
+ # the tokens that don't start with - are processed OOB
72
+ next unless @args[i][0] == ?-
73
+ case @args[i]
74
+ when '-in'
75
+ @in = File.open(@args[i + 1], 'rb')
76
+ @cleanup_procs << Proc.new { @in.close }
77
+ when '-inkey'
78
+ @in_key = File.open(@args[i + 1], 'r')
79
+ @cleanup_procs << Proc.new { @in_key.close }
80
+ when '-indata'
81
+ @in_data = File.open(@args[i + 1], 'r')
82
+ @cleanup_procs << Proc.new { @in_data.close }
83
+ when '-out'
84
+ @out = File.open(@args[i + 1], 'wb')
85
+ @cleanup_procs << Proc.new { @out.close }
86
+ else
87
+ @arg_bag[@args[i][1..-1].to_sym] = true
88
+ end
89
+ end
90
+ end
91
+
92
+ def cleanup
93
+ @cleanup_procs.each { |p| p.call }
94
+ end
95
+
96
+ def connect_to_tem
97
+ @tem = Tem.auto_tem
98
+ if @tem
99
+ @cleanup_procs << Proc.new { @tem.disconnect; }
100
+ end
101
+ end
102
+
103
+ def self.run(args, test_options = {})
104
+ ex = self.new args, test_options
105
+ ex.run
106
+ ex.cleanup
107
+ end
108
+ end
109
+
110
+ end # namespace Tem::OpenSSL
@@ -0,0 +1,61 @@
1
+ require 'pp'
2
+
3
+ # :nodoc: namespace
4
+ module Tem::OpenSSL
5
+
6
+ class Key
7
+ include TemTools
8
+
9
+ attr_reader :pub_key
10
+
11
+ def initialize(pub_key, priv_decrypt_sec, priv_encrypt_sec, priv_sign_sec)
12
+ @pub_key = pub_key
13
+ @priv_decrypt_sec = priv_decrypt_sec
14
+ @priv_encrypt_sec = priv_encrypt_sec
15
+ @priv_sign_sec = priv_sign_sec
16
+ end
17
+
18
+ def to_tkfile
19
+ @pub_key.ssl_key.to_s + [@priv_decrypt_sec.to_array,
20
+ @priv_encrypt_sec.to_array,
21
+ @priv_sign_sec.to_array].to_yaml
22
+ end
23
+
24
+ def privk_decrypt(data, tem)
25
+ TemTools.crypt_with_sec data, @priv_decrypt_sec, tem
26
+ end
27
+
28
+ def privk_encrypt(data, tem)
29
+ TemTools.crypt_with_sec data, @priv_encrypt_sec, tem
30
+ end
31
+
32
+ def privk_sign(data, tem)
33
+ TemTools.sign_with_sec data, @priv_sign_sec, tem
34
+ end
35
+
36
+ def self.new_tem_key(tem)
37
+ keys = TemTools.generate_key_on_tem tem
38
+ decrypt_sec = TemTools.crypting_sec keys[:privk], tem, :decrypt
39
+ encrypt_sec = TemTools.crypting_sec keys[:privk], tem, :encrypt
40
+ sign_sec = TemTools.signing_sec keys[:privk], tem
41
+ self.new keys[:pubk], decrypt_sec, encrypt_sec, sign_sec
42
+ end
43
+
44
+ def self.load_from_tkfile(file)
45
+ ossl_pub_key = OpenSSL::PKey::RSA.new file
46
+ pub_key = Tem::Key.new_from_ssl_key ossl_pub_key
47
+ begin
48
+ ds_ary, es_ary, ss_ary = *YAML.load(file)
49
+ priv_decrypt_sec = Tem::SecPack.new_from_array ds_ary
50
+ priv_encrypt_sec = Tem::SecPack.new_from_array es_ary
51
+ priv_sign_sec = Tem::SecPack.new_from_array ss_ary
52
+ rescue
53
+ priv_decrypt_sec = nil
54
+ priv_encrypt_sec = nil
55
+ priv_sign_sec = nil
56
+ end
57
+ self.new pub_key, priv_decrypt_sec, priv_encrypt_sec, priv_sign_sec
58
+ end
59
+ end
60
+
61
+ end # namespace Tem::OpenSSL
@@ -0,0 +1,129 @@
1
+ # :nodoc: namespace
2
+ module Tem::OpenSSL
3
+
4
+ module TemTools
5
+ # Generate an RSA key pair on the TEM.
6
+ #
7
+ # Runs slower than OpenSSL-based generation, but uses a hardware RNG.
8
+ def self.generate_key_on_tem(tem)
9
+ kdata = tem.tk_gen_key :asymmetric
10
+ pubk = tem.tk_read_key kdata[:pubk_id], kdata[:authz]
11
+ tem.tk_delete_key kdata[:pubk_id], kdata[:authz]
12
+ privk = tem.tk_read_key kdata[:privk_id], kdata[:authz]
13
+ tem.tk_delete_key kdata[:privk_id], kdata[:authz]
14
+
15
+ return {:privk => privk, :pubk => pubk}
16
+ end
17
+
18
+ # Generates a SECpack that encrypts/decrypts a user-supplied blob.
19
+ #
20
+ # The SECpack is tied down to a TEM.
21
+ def self.crypting_sec(key, tem, mode = :decrypt)
22
+ crypt_sec = tem.assemble do |s|
23
+ # load the key in the TEM
24
+ s.ldwc :const => :key_data
25
+ s.rdk
26
+ # allocate the output buffer
27
+ s.ldwc :const => 512
28
+ s.outnew
29
+ # decrypt the given data
30
+ s.ldw :from => :input_length
31
+ s.ldwc :const => :input_data
32
+ s.ldwc :const => -1
33
+ s.send({:encrypt => :kevb, :decrypt => :kdvb}[mode])
34
+ s.halt
35
+
36
+ # key material
37
+ s.label :key_data
38
+ s.data :tem_ubyte, key.to_tem_key
39
+
40
+ # user-supplied argument: the length of the blob to be encrypted/decrypted
41
+ s.label :input_length
42
+ s.data :tem_ushort, 256
43
+
44
+ # user-supplied argument: the blob to be encrypted/decrypted
45
+ s.label :input_data
46
+ s.zeros :tem_ubyte, 512
47
+
48
+ s.label :sec_stack
49
+ s.stack 4
50
+ end
51
+ crypt_sec.bind tem.pubek, :key_data, :input_length
52
+ crypt_sec
53
+ end
54
+
55
+ # Generates a SECpack that decrypts a user-supplied blob.
56
+ #
57
+ # The SECpack is tied down to a TEM.
58
+ def self.signing_sec(key, tem)
59
+ sign_sec = tem.assemble do |s|
60
+ # load the key in the TEM
61
+ s.ldwc :const => :key_data
62
+ s.rdk
63
+ # allocate the output buffer
64
+ s.ldwc :const => key.ssl_key.n.num_bytes + 1
65
+ s.outnew
66
+ # sign the given data
67
+ s.ldw :from => :input_length
68
+ s.ldwc :const => :input_data
69
+ s.ldwc :const => -1
70
+ s.ksvb
71
+ s.halt
72
+
73
+ # key material
74
+ s.label :key_data
75
+ s.data :tem_ubyte, key.to_tem_key
76
+
77
+ # user-supplied argument: the length of the blob to be signed
78
+ s.label :input_length
79
+ s.data :tem_ushort, 256
80
+
81
+ # user-supplied argument: the blob to be signed
82
+ s.label :input_data
83
+ s.zeros :tem_ubyte, 512
84
+
85
+ s.label :sec_stack
86
+ s.stack 4
87
+ end
88
+ sign_sec.bind tem.pubek, :key_data, :input_length
89
+ sign_sec
90
+ end
91
+
92
+
93
+ # Encrypts/decrypts using a SECpack generated via a previous call to
94
+ # crypting_sec.
95
+ def self.crypt_with_sec(encrypted_data, dec_sec, tem)
96
+ # convert the data string to an array of numbers
97
+ ed = encrypted_data.unpack 'C*'
98
+
99
+ # patch the data and its length into the SEC
100
+ elen = tem.to_tem_ushort ed.length
101
+ dec_sec.body[dec_sec.label_address(:input_length), elen.length] = elen
102
+ dec_sec.body[dec_sec.label_address(:input_data), ed.length] = ed
103
+
104
+ # run the sec and convert its output to a string
105
+ dd = tem.execute dec_sec
106
+ decrypted_data = dd.pack 'C*'
107
+
108
+ return decrypted_data
109
+ end
110
+
111
+ # Signs using a SECpack generated via a previous call to signing_sec.
112
+ def self.sign_with_sec(data, sign_sec, tem)
113
+ # convert the data string to an array of numbers
114
+ d = data.unpack 'C*'
115
+
116
+ # patch the data and its length into the SEC
117
+ len = tem.to_tem_ushort d.length
118
+ sign_sec.body[sign_sec.label_address(:input_length), len.length] = len
119
+ sign_sec.body[sign_sec.label_address(:input_data), d.length] = d
120
+
121
+ # run the sec and convert its output to a string
122
+ s = tem.execute sign_sec
123
+ signature = s.pack 'C*'
124
+
125
+ return signature
126
+ end
127
+ end
128
+
129
+ end # namespace Tem::OpenSSL
@@ -0,0 +1,9 @@
1
+ require 'rubygems'
2
+ require 'tem_ruby'
3
+
4
+ module Tem::OpenSSL
5
+ end
6
+
7
+ require 'openssl/tem_tools.rb'
8
+ require 'openssl/key.rb'
9
+ require 'openssl/executor.rb'
@@ -0,0 +1,36 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{tem_openssl}
5
+ s.version = "0.3.6"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Victor Costan"]
9
+ s.date = %q{2009-05-31}
10
+ s.default_executable = %q{openssl_tem}
11
+ s.description = %q{TEM (Trusted Execution Module) engine for OpenSSL.}
12
+ s.email = %q{victor@costan.us}
13
+ s.executables = ["openssl_tem"]
14
+ s.extra_rdoc_files = ["bin/openssl_tem", "CHANGELOG", "lib/openssl/executor.rb", "lib/openssl/key.rb", "lib/openssl/tem_tools.rb", "lib/tem_openssl.rb", "LICENSE", "README"]
15
+ s.files = ["bin/openssl_tem", "CHANGELOG", "lib/openssl/executor.rb", "lib/openssl/key.rb", "lib/openssl/tem_tools.rb", "lib/tem_openssl.rb", "LICENSE", "Manifest", "Rakefile", "README", "test/test_executor.rb", "tem_openssl.gemspec"]
16
+ s.homepage = %q{http://tem.rubyforge.org}
17
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Tem_openssl", "--main", "README"]
18
+ s.require_paths = ["lib"]
19
+ s.rubyforge_project = %q{tem}
20
+ s.rubygems_version = %q{1.3.3}
21
+ s.summary = %q{TEM (Trusted Execution Module) engine for OpenSSL.}
22
+ s.test_files = ["test/test_executor.rb"]
23
+
24
+ if s.respond_to? :specification_version then
25
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
26
+ s.specification_version = 3
27
+
28
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
29
+ s.add_runtime_dependency(%q<tem_ruby>, [">= 0.10.2"])
30
+ else
31
+ s.add_dependency(%q<tem_ruby>, [">= 0.10.2"])
32
+ end
33
+ else
34
+ s.add_dependency(%q<tem_ruby>, [">= 0.10.2"])
35
+ end
36
+ end
@@ -0,0 +1,54 @@
1
+ require 'tem_openssl'
2
+ require 'test/unit'
3
+
4
+ class ExecutorTest < Test::Unit::TestCase
5
+ def setup
6
+ Tem::OpenSSL::Executor.run ['reset']
7
+
8
+ # generate key and extract public key
9
+ Tem::OpenSSL::Executor.run ['rsagen', '2048', '-out', 'test_key.tkey']
10
+ Tem::OpenSSL::Executor.run ['rsa', '-in', 'test_key.tkey', '-out', 'test_key.pem', '-pubout'], :no_tem => true
11
+ end
12
+
13
+ def teardown
14
+ ['test_key.tkey', 'test_key.pem'].each { |fname| File.delete fname }
15
+ end
16
+
17
+ def test_encryption
18
+ # test encryption and decryption (using the PEM file for the public key)
19
+ plain_text = 'Simple encryption test.\n'
20
+ File.open('test_plain.txt', 'wb') { |f| f.write plain_text }
21
+ Tem::OpenSSL::Executor.run ['rsautl', '-encrypt', '-inkey', 'test_key.pem', '-in', 'test_plain.txt', '-pkcs', '-out', 'test_enc.txt'], :no_tem => true
22
+ Tem::OpenSSL::Executor.run ['rsautl', '-decrypt', '-inkey', 'test_key.tkey', '-in', 'test_enc.txt', '-pkcs', '-out', 'test_plain2.txt']
23
+ assert_equal plain_text, File.open('test_plain2.txt', 'rb') { |f| f.read }, 'data corruption in encryption/decryption'
24
+ ['test_plain.txt', 'test_plain2.txt', 'test_enc.txt'].each { |fname| File.delete fname }
25
+
26
+ # test encryption and decryption (using the TEM-bound file for the public key)
27
+ plain_text = 'Simple encryption test.\n'
28
+ File.open('test_plain.txt', 'wb') { |f| f.write plain_text }
29
+ Tem::OpenSSL::Executor.run ['rsautl', '-encrypt', '-inkey', 'test_key.tkey', '-in', 'test_plain.txt', '-pkcs', '-out', 'test_enc.txt']
30
+ Tem::OpenSSL::Executor.run ['rsautl', '-decrypt', '-inkey', 'test_key.tkey', '-in', 'test_enc.txt', '-pkcs', '-out', 'test_plain2.txt']
31
+ assert_equal plain_text, File.open('test_plain2.txt', 'rb') { |f| f.read }, 'data corruption in encryption/decryption'
32
+ ['test_plain.txt', 'test_plain2.txt', 'test_enc.txt'].each { |fname| File.delete fname }
33
+ end
34
+
35
+ def test_fake_signing
36
+ # test fake (openssl-compatible) signing
37
+ plain_text = 'Simple fake-signing test.\n'
38
+ File.open('test_plain.txt', 'wb') { |f| f.write plain_text }
39
+ Tem::OpenSSL::Executor.run ['rsautl', '-sign', '-inkey', 'test_key.tkey', '-in', 'test_plain.txt', '-pkcs', '-out', 'test_fsign.txt']
40
+ Tem::OpenSSL::Executor.run ['rsautl', '-verify', '-inkey', 'test_key.pem', '-in', 'test_fsign.txt', '-pkcs', '-out', 'test_fverify.txt']
41
+ assert_equal plain_text, File.open('test_fverify.txt', 'rb') { |f| f.read }, 'data corruption in fake-sign/verification'
42
+ ['test_plain.txt', 'test_fsign.txt', 'test_fverify.txt'].each { |fname| File.delete fname }
43
+ end
44
+
45
+ def test_xsigning
46
+ # test proper signing (using the PEM file for the public key)
47
+ plain_text = 'Simple signing test.\n'
48
+ File.open('test_plain.txt', 'wb') { |f| f.write plain_text }
49
+ Tem::OpenSSL::Executor.run ['rsautl', '-xsign', '-inkey', 'test_key.tkey', '-in', 'test_plain.txt', '-pkcs', '-out', 'test_sign.txt']
50
+ Tem::OpenSSL::Executor.run ['rsautl', '-xverify', '-inkey', 'test_key.pem', '-in', 'test_sign.txt', '-indata', 'test_plain.txt', '-pkcs', '-out', 'test_verify.txt'], :no_tem => true
51
+ assert_equal "true", File.open('test_verify.txt', 'rb') { |f| f.read }, 'data corruption in sign/verification'
52
+ ['test_plain.txt', 'test_sign.txt', 'test_verify.txt'].each { |fname| File.delete fname }
53
+ end
54
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: costan-tem_openssl
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.6
5
+ platform: ruby
6
+ authors:
7
+ - Victor Costan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-31 00:00:00 -07:00
13
+ default_executable: openssl_tem
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: tem_ruby
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.10.2
24
+ version:
25
+ description: TEM (Trusted Execution Module) engine for OpenSSL.
26
+ email: victor@costan.us
27
+ executables:
28
+ - openssl_tem
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - bin/openssl_tem
33
+ - CHANGELOG
34
+ - lib/openssl/executor.rb
35
+ - lib/openssl/key.rb
36
+ - lib/openssl/tem_tools.rb
37
+ - lib/tem_openssl.rb
38
+ - LICENSE
39
+ - README
40
+ files:
41
+ - bin/openssl_tem
42
+ - CHANGELOG
43
+ - lib/openssl/executor.rb
44
+ - lib/openssl/key.rb
45
+ - lib/openssl/tem_tools.rb
46
+ - lib/tem_openssl.rb
47
+ - LICENSE
48
+ - Manifest
49
+ - Rakefile
50
+ - README
51
+ - test/test_executor.rb
52
+ - tem_openssl.gemspec
53
+ has_rdoc: false
54
+ homepage: http://tem.rubyforge.org
55
+ post_install_message:
56
+ rdoc_options:
57
+ - --line-numbers
58
+ - --inline-source
59
+ - --title
60
+ - Tem_openssl
61
+ - --main
62
+ - README
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: "0"
70
+ version:
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: "1.2"
76
+ version:
77
+ requirements: []
78
+
79
+ rubyforge_project: tem
80
+ rubygems_version: 1.2.0
81
+ signing_key:
82
+ specification_version: 3
83
+ summary: TEM (Trusted Execution Module) engine for OpenSSL.
84
+ test_files:
85
+ - test/test_executor.rb