Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make compatible with ruby 2.2.x #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
source "http://rubygems.org"

group :development do
gem "jeweler", "~> 1.6.4"
gem "jeweler"
gem "test-unit"
end
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Jeweler::Tasks.new do |gem|
gem.description = %Q{Adds PKCS8 key format support to OpenSSL::PKey::RSA}
gem.email = "[email protected]"
gem.authors = [ "Scott Tadman" ]
gem.required_ruby_version = '~> 2.0'
# dependencies defined in Gemfile
end

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.2
0.2.0
6 changes: 4 additions & 2 deletions ext/openssl_pkcs8/openssl_pkcs8.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ VALUE ePKeyError;
VALUE eOSSLError;
VALUE cCipher;

extern const rb_data_type_t ossl_evp_pkey_type;

#define GetPKey(obj, pkey) do {\
Data_Get_Struct(obj, EVP_PKEY, pkey);\
TypedData_Get_Struct((obj), EVP_PKEY, &ossl_evp_pkey_type, (pkey)); \
if (!pkey) { \
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!");\
} \
Expand Down Expand Up @@ -186,6 +188,6 @@ void Init_openssl_pkcs8()
eOSSLError = rb_const_get(mOSSL,rb_intern("OpenSSLError"));
ePKeyError = rb_const_get(mPKey, rb_intern("PKeyError"));
eRSAError = rb_const_get(mPKey, rb_intern("RSAError"));

rb_define_method(cRSA, "to_pem_pkcs8", openssl_rsa_to_pem_pkcs8, -1);
}
22 changes: 14 additions & 8 deletions openssl_pkcs8.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
# stub: openssl_pkcs8 0.2.0 ruby lib
# stub: ext/openssl_pkcs8/extconf.rb

Gem::Specification.new do |s|
s.name = "openssl_pkcs8"
s.version = "0.1.2"
s.version = "0.2.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Scott Tadman"]
s.date = "2012-01-20"
s.date = "2015-05-20"
s.description = "Adds PKCS8 key format support to OpenSSL::PKey::RSA"
s.email = "[email protected]"
s.extensions = ["ext/openssl_pkcs8/extconf.rb"]
Expand All @@ -33,20 +36,23 @@ Gem::Specification.new do |s|
]
s.homepage = "http://github.com/twg/openssl_pkcs8"
s.licenses = ["MIT"]
s.require_paths = ["lib"]
s.rubygems_version = "1.8.11"
s.required_ruby_version = Gem::Requirement.new("~> 2.0")
s.rubygems_version = "2.4.7"
s.summary = "OpenSSL RSA PKCS8 Extension"

if s.respond_to? :specification_version then
s.specification_version = 3
s.specification_version = 4

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
s.add_development_dependency(%q<jeweler>, [">= 0"])
s.add_development_dependency(%q<test-unit>, [">= 0"])
else
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
s.add_dependency(%q<jeweler>, [">= 0"])
s.add_dependency(%q<test-unit>, [">= 0"])
end
else
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
s.add_dependency(%q<jeweler>, [">= 0"])
s.add_dependency(%q<test-unit>, [">= 0"])
end
end