ruby-saml-mod 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/xml_sec.rb +15 -17
  2. data/ruby-saml-mod.gemspec +2 -2
  3. metadata +4 -3
data/lib/xml_sec.rb CHANGED
@@ -31,7 +31,7 @@ require "digest/sha1"
31
31
 
32
32
  module XMLSecurity
33
33
  extend FFI::Library
34
- ffi_lib "xmlsec1"
34
+ ffi_lib "xmlsec1-openssl"
35
35
 
36
36
  enum :xmlSecKeyDataFormat, [
37
37
  :xmlSecKeyDataFormatUnknown,
@@ -176,17 +176,16 @@ module XMLSecurity
176
176
  attach_function :xmlSecFindNode, [ :pointer, :string, :string ], :pointer
177
177
  attach_function :xmlSecDSigCtxCreate, [ :pointer ], XmlSecDSigCtx.by_ref
178
178
  attach_function :xmlSecDSigCtxVerify, [ XmlSecDSigCtx.by_ref, :pointer ], :int
179
- attach_function :xmlSecCryptoInit, [], :int
180
- attach_function :xmlSecCryptoDLLoadLibrary, [ :string ], :int
181
- attach_function :xmlSecCryptoAppInit, [ :pointer ], :int
179
+ attach_function :xmlSecOpenSSLInit, [], :int
180
+ attach_function :xmlSecOpenSSLAppInit, [ :pointer ], :int
182
181
  attach_function :xmlSecAddIDs, [ :pointer, :pointer, :pointer ], :void
183
182
  attach_function :xmlSecDSigCtxDestroy, [ XmlSecDSigCtx.by_ref ], :void
184
183
 
185
184
  attach_function :xmlSecKeysMngrCreate, [], :pointer
186
- attach_function :xmlSecCryptoAppDefaultKeysMngrInit, [ :pointer ], :int
187
- attach_function :xmlSecCryptoAppKeyLoad, [ :string, :xmlSecKeyDataFormat, :pointer, :pointer, :pointer ], :pointer
188
- attach_function :xmlSecCryptoAppKeyLoadMemory, [ :pointer, :uint, :xmlSecKeyDataFormat, :pointer, :pointer, :pointer ], :pointer
189
- attach_function :xmlSecCryptoAppDefaultKeysMngrAdoptKey, [ :pointer, :pointer ], :int
185
+ attach_function :xmlSecOpenSSLAppDefaultKeysMngrInit, [ :pointer ], :int
186
+ attach_function :xmlSecOpenSSLAppKeyLoad, [ :string, :xmlSecKeyDataFormat, :pointer, :pointer, :pointer ], :pointer
187
+ attach_function :xmlSecOpenSSLAppKeyLoadMemory, [ :pointer, :uint, :xmlSecKeyDataFormat, :pointer, :pointer, :pointer ], :pointer
188
+ attach_function :xmlSecOpenSSLAppDefaultKeysMngrAdoptKey, [ :pointer, :pointer ], :int
190
189
  attach_function :xmlSecKeysMngrDestroy, [ :pointer ], :void
191
190
 
192
191
  attach_function :xmlSecEncCtxCreate, [ :pointer ], :pointer
@@ -201,9 +200,8 @@ module XMLSecurity
201
200
 
202
201
  self.xmlInitParser
203
202
  raise "Failed initializing XMLSec" if self.xmlSecInit < 0
204
- raise "Failed initializing xmlsec with openssl" if self.xmlSecCryptoDLLoadLibrary("openssl") < 0
205
- raise "Failed initializing app crypto" if self.xmlSecCryptoAppInit(nil) < 0
206
- raise "Failed initializing crypto" if self.xmlSecCryptoInit < 0
203
+ raise "Failed initializing app crypto" if self.xmlSecOpenSSLAppInit(nil) < 0
204
+ raise "Failed initializing crypto" if self.xmlSecOpenSSLInit < 0
207
205
 
208
206
  module SignedDocument
209
207
  attr_reader :validation_error
@@ -260,10 +258,10 @@ module XMLSecurity
260
258
  begin
261
259
  # set up the keymgr
262
260
  kmgr = XMLSecurity.xmlSecKeysMngrCreate
263
- raise "failed initializing key mgr" if XMLSecurity.xmlSecCryptoAppDefaultKeysMngrInit(kmgr) < 0
264
- key = XMLSecurity.xmlSecCryptoAppKeyLoadMemory(pem, pem.length, :xmlSecKeyDataFormatPem, nil, nil, nil)
261
+ raise "failed initializing key mgr" if XMLSecurity.xmlSecOpenSSLAppDefaultKeysMngrInit(kmgr) < 0
262
+ key = XMLSecurity.xmlSecOpenSSLAppKeyLoadMemory(pem, pem.length, :xmlSecKeyDataFormatPem, nil, nil, nil)
265
263
  raise "failed loading key" if key.null?
266
- raise "failed adding key to mgr" if XMLSecurity.xmlSecCryptoAppDefaultKeysMngrAdoptKey(kmgr, key) < 0
264
+ raise "failed adding key to mgr" if XMLSecurity.xmlSecOpenSSLAppDefaultKeysMngrAdoptKey(kmgr, key) < 0
267
265
 
268
266
  # parse the xml
269
267
  doc = XMLSecurity.xmlSecParseMemory(xml, xml.length, 0)
@@ -322,11 +320,11 @@ module XMLSecurity
322
320
  result = nil
323
321
  begin
324
322
  kmgr = XMLSecurity.xmlSecKeysMngrCreate
325
- raise "Failed initializing key mgr" if XMLSecurity.xmlSecCryptoAppDefaultKeysMngrInit(kmgr) < 0
323
+ raise "Failed initializing key mgr" if XMLSecurity.xmlSecOpenSSLAppDefaultKeysMngrInit(kmgr) < 0
326
324
 
327
- key = XMLSecurity.xmlSecCryptoAppKeyLoad(settings.xmlsec_privatekey, :xmlSecKeyDataFormatPem, nil, nil, nil)
325
+ key = XMLSecurity.xmlSecOpenSSLAppKeyLoad(settings.xmlsec_privatekey, :xmlSecKeyDataFormatPem, nil, nil, nil)
328
326
  raise "Failed loading key" if key.null?
329
- raise "Failed adding key to mgr" if XMLSecurity.xmlSecCryptoAppDefaultKeysMngrAdoptKey(kmgr, key) < 0
327
+ raise "Failed adding key to mgr" if XMLSecurity.xmlSecOpenSSLAppDefaultKeysMngrAdoptKey(kmgr, key) < 0
330
328
 
331
329
  doc = XMLSecurity.xmlSecParseMemory(xmlstr, xmlstr.length, 0)
332
330
  raise "Failed to parse node" if doc.null?
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{ruby-saml-mod}
3
- s.version = "0.1.16"
3
+ s.version = "0.1.17"
4
4
 
5
- s.authors = ["OneLogin LLC", "Bracken", "Zach", "Cody"]
5
+ s.authors = ["OneLogin LLC", "Bracken", "Zach", "Cody", "Jeremy"]
6
6
  s.date = %q{2012-06-20}
7
7
  s.extra_rdoc_files = [
8
8
  "LICENSE"
metadata CHANGED
@@ -1,19 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-saml-mod
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 16
10
- version: 0.1.16
9
+ - 17
10
+ version: 0.1.17
11
11
  platform: ruby
12
12
  authors:
13
13
  - OneLogin LLC
14
14
  - Bracken
15
15
  - Zach
16
16
  - Cody
17
+ - Jeremy
17
18
  autorequire:
18
19
  bindir: bin
19
20
  cert_chain: []