nokogiri-xmlsec-instructure 0.10.1 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/push.yml +40 -0
- data/.gitignore +1 -0
- data/.tool-versions +1 -0
- data/Appraisals +9 -0
- data/ext/nokogiri_ext_xmlsec/extconf.rb +7 -12
- data/ext/nokogiri_ext_xmlsec/init.c +1 -1
- data/ext/nokogiri_ext_xmlsec/nokogiri_decrypt_with_key.c +1 -6
- data/ext/nokogiri_ext_xmlsec/nokogiri_encrypt_with_key.c +1 -1
- data/ext/nokogiri_ext_xmlsec/nokogiri_helpers_set_attribute_id.c +2 -5
- data/ext/nokogiri_ext_xmlsec/nokogiri_sign.c +1 -1
- data/ext/nokogiri_ext_xmlsec/nokogiri_verify_with.c +1 -1
- data/ext/nokogiri_ext_xmlsec/xmlsecrb.h +6 -0
- data/gemfiles/nokogiri_12.5.gemfile +7 -0
- data/gemfiles/nokogiri_13.10.gemfile +7 -0
- data/lib/xmlsec/version.rb +1 -1
- data/nokogiri-xmlsec-instructure.gemspec +1 -0
- data/spec/fixtures/sign3-result.xml +2 -1
- metadata +22 -4
- data/.travis.yml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d80bf299c2e7900122535982dfde8b7b6ab67ea53528b0b055c3758b9b9753f
|
4
|
+
data.tar.gz: 379cbbff6fc67ac23cf9d604d15aea36f79e58418b034dcf5e5b45db3c86a739
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e87ccfb10dfc8d9afe6964c58f4a56179fde5faa0ab007fb8bb5b62a038d6bc609d7f96efc09fbc394d3e51af568f3134133d87d5a843d6a456fe949dca464c2
|
7
|
+
data.tar.gz: 705acc4113dc8380a29c3ef001a19eceda6a128e9c08441a3ebd9f135452f5d0a22419d8cfdd64f2002841132687f10f84af09fe998d19f701aeff5d4860e21a
|
@@ -0,0 +1,40 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
|
14
|
+
strategy:
|
15
|
+
fail-fast: false
|
16
|
+
matrix:
|
17
|
+
ruby-version: [3.0, 2.7]
|
18
|
+
gemfile: ['gemfiles/nokogiri_13.10.gemfile', 'gemfiles/nokogiri_12.5.gemfile']
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- name: Install libxmlsec
|
22
|
+
run: |
|
23
|
+
sudo apt-get update
|
24
|
+
sudo apt-get install -y libxmlsec1-dev
|
25
|
+
- uses: actions/checkout@v3
|
26
|
+
- name: Set up Ruby
|
27
|
+
uses: ruby/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby-version }}
|
30
|
+
bundler-cache: true
|
31
|
+
env:
|
32
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
33
|
+
- name: Install dependencies
|
34
|
+
run: bundle install
|
35
|
+
env:
|
36
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
37
|
+
- name: Run tests
|
38
|
+
run: bundle exec rake
|
39
|
+
env:
|
40
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
data/.gitignore
CHANGED
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.0.4
|
data/Appraisals
ADDED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'mkmf'
|
2
|
+
require 'nokogiri'
|
2
3
|
|
3
4
|
def barf message = 'dependencies not met'
|
4
5
|
raise message
|
@@ -10,18 +11,12 @@ pkg_config('xmlsec1')
|
|
10
11
|
$CFLAGS << " " + `xmlsec1-config --cflags`.strip
|
11
12
|
$CFLAGS << " -fvisibility=hidden"
|
12
13
|
|
13
|
-
|
14
|
-
puts "Changing escaping: #{$CFLAGS}"
|
15
|
-
$CFLAGS['-DXMLSEC_CRYPTO=\\\\\\"openssl\\\\\\"'] =
|
16
|
-
'-DXMLSEC_CRYPTO=\\"openssl\\"'
|
17
|
-
end
|
18
|
-
|
19
|
-
if $CFLAGS =~ /\-DXMLSEC_CRYPTO="openssl"/
|
20
|
-
puts "Ensure we escaping: #{$CFLAGS}"
|
21
|
-
$CFLAGS['-DXMLSEC_CRYPTO="openssl"'] =
|
22
|
-
'-DXMLSEC_CRYPTO=\\"openssl\\"'
|
23
|
-
end
|
14
|
+
$CFLAGS << Dir[Gem.loaded_specs['nokogiri'].full_gem_path + "/ext/*"].map { |dir| " -I#{dir}"}.join("")
|
24
15
|
|
25
|
-
puts "
|
16
|
+
puts "Cflags: #{$CFLAGS}"
|
26
17
|
$libs = `xmlsec1-config --libs`.strip
|
18
|
+
|
19
|
+
# We reference symbols out of nokogiri but don't link directly against it
|
20
|
+
$LDFLAGS << ' -Wl,-undefined,dynamic_lookup'
|
21
|
+
|
27
22
|
create_makefile('nokogiri_ext_xmlsec')
|
@@ -47,7 +47,7 @@ void Init_nokogiri_ext_xmlsec() {
|
|
47
47
|
}
|
48
48
|
// load crypto
|
49
49
|
#ifdef XMLSEC_CRYPTO_DYNAMIC_LOADING
|
50
|
-
if(xmlSecCryptoDLLoadLibrary(
|
50
|
+
if(xmlSecCryptoDLLoadLibrary(NULL) < 0) {
|
51
51
|
rb_raise(rb_eRuntimeError,
|
52
52
|
"Error: unable to load default xmlsec-crypto library. Make sure"
|
53
53
|
"that you have it installed and check shared libraries path\n"
|
@@ -1,11 +1,6 @@
|
|
1
1
|
#include "xmlsecrb.h"
|
2
2
|
#include "util.h"
|
3
3
|
|
4
|
-
// technically we should include nokogiri.h, but we don't know
|
5
|
-
// how to find it. we _know_ this function will exist at runtime
|
6
|
-
// though, so just declare it here
|
7
|
-
void noko_xml_document_pin_node(xmlNodePtr);
|
8
|
-
|
9
4
|
VALUE decrypt_with_key(VALUE self, VALUE rb_key_name, VALUE rb_key) {
|
10
5
|
VALUE rb_exception_result = Qnil;
|
11
6
|
const char* exception_message = NULL;
|
@@ -21,7 +16,7 @@ VALUE decrypt_with_key(VALUE self, VALUE rb_key_name, VALUE rb_key) {
|
|
21
16
|
|
22
17
|
Check_Type(rb_key, T_STRING);
|
23
18
|
Check_Type(rb_key_name, T_STRING);
|
24
|
-
|
19
|
+
Noko_Node_Get_Struct(self, xmlNode, node);
|
25
20
|
key = RSTRING_PTR(rb_key);
|
26
21
|
keyLength = RSTRING_LEN(rb_key);
|
27
22
|
keyName = StringValueCStr(rb_key_name);
|
@@ -53,7 +53,7 @@ VALUE encrypt_with_key(VALUE self, VALUE rb_rsa_key_name, VALUE rb_rsa_key,
|
|
53
53
|
goto done;
|
54
54
|
}
|
55
55
|
|
56
|
-
|
56
|
+
Noko_Node_Get_Struct(self, xmlNode, node);
|
57
57
|
doc = node->doc;
|
58
58
|
|
59
59
|
// create encryption template to encrypt XML file and replace
|
@@ -1,9 +1,6 @@
|
|
1
1
|
#include "xmlsecrb.h"
|
2
2
|
#include "util.h"
|
3
3
|
|
4
|
-
// declaration from Nokogiri proper
|
5
|
-
VALUE noko_xml_node_wrap(VALUE klass, xmlNodePtr node) ;
|
6
|
-
|
7
4
|
VALUE set_id_attribute(VALUE self, VALUE rb_attr_name) {
|
8
5
|
VALUE rb_exception_result = Qnil;
|
9
6
|
const char* exception_message = NULL;
|
@@ -17,7 +14,7 @@ VALUE set_id_attribute(VALUE self, VALUE rb_attr_name) {
|
|
17
14
|
|
18
15
|
resetXmlSecError();
|
19
16
|
|
20
|
-
|
17
|
+
Noko_Node_Get_Struct(self, xmlNode, node);
|
21
18
|
Check_Type(rb_attr_name, T_STRING);
|
22
19
|
idName = StringValueCStr(rb_attr_name);
|
23
20
|
|
@@ -86,7 +83,7 @@ VALUE get_id(VALUE self, VALUE rb_id)
|
|
86
83
|
xmlDocPtr doc;
|
87
84
|
|
88
85
|
Check_Type(rb_id, T_STRING);
|
89
|
-
|
86
|
+
Noko_Node_Get_Struct(self, xmlDoc, doc);
|
90
87
|
prop = xmlGetID(doc, (const xmlChar *)StringValueCStr(rb_id));
|
91
88
|
if (prop) {
|
92
89
|
return noko_xml_node_wrap(Qnil, (xmlNodePtr)prop);
|
@@ -90,7 +90,7 @@ VALUE sign(VALUE self, VALUE rb_opts) {
|
|
90
90
|
goto done;
|
91
91
|
}
|
92
92
|
|
93
|
-
|
93
|
+
Noko_Node_Get_Struct(self, xmlNode, envelopeNode);
|
94
94
|
doc = envelopeNode->doc;
|
95
95
|
// create signature template for enveloped signature.
|
96
96
|
signNode = xmlSecTmplSignatureCreate(doc, xmlSecTransformExclC14NId,
|
@@ -146,7 +146,7 @@ VALUE verify_with(VALUE self, VALUE rb_opts) {
|
|
146
146
|
resetXmlSecError();
|
147
147
|
|
148
148
|
Check_Type(rb_opts, T_HASH);
|
149
|
-
|
149
|
+
Noko_Node_Get_Struct(self, xmlNode, node);
|
150
150
|
|
151
151
|
// verify start node
|
152
152
|
if(!xmlSecCheckNodeName(node, xmlSecNodeSignature, xmlSecDSigNs)) {
|
@@ -20,6 +20,12 @@
|
|
20
20
|
#include <xmlsec/crypto.h>
|
21
21
|
#include <xmlsec/errors.h>
|
22
22
|
|
23
|
+
#include <nokogiri.h>
|
24
|
+
// Lifted from modern nokogiri.h
|
25
|
+
#ifndef Noko_Node_Get_Struct
|
26
|
+
#define Noko_Node_Get_Struct(obj,type,sval) ((sval) = (type*)DATA_PTR(obj))
|
27
|
+
#endif
|
28
|
+
|
23
29
|
// TODO(awong): Support non-gcc and non-clang compilers.
|
24
30
|
#define EXTENSION_EXPORT __attribute__((visibility("default")))
|
25
31
|
|
data/lib/xmlsec/version.rb
CHANGED
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
|
31
31
|
spec.add_dependency 'nokogiri', '>= 1.11.2'
|
32
32
|
|
33
|
+
spec.add_development_dependency "appraisal"
|
33
34
|
spec.add_development_dependency "bundler", "~> 2.1"
|
34
35
|
spec.add_development_dependency "byebug"
|
35
36
|
spec.add_development_dependency "rake"
|
@@ -32,7 +32,8 @@ eymfHtzOeY86WyvfsjZmaz2XnIo9dzZsK71yMEKkgvXQnnYy9pK0NaYcG0B0hcii
|
|
32
32
|
gSVEWpEpCSo560x0mSuLnJYdQQzZ/L6xvxZ1AgMBAAEwDQYJKoZIhvcNAQEFBQAD
|
33
33
|
gYEATyK/RlfpohUVimgFkycTF2hyusjctseXoZDCctgg/STMsL8iA0P9YB6k91GC
|
34
34
|
kWpwevuiwarD1MfSUV6goPINFkIBvfK+5R9lpHaTqqs615z8T9R5VJgaLcFe3tWd
|
35
|
-
7oq3V2q5Nl6MrZfXj2N07qe6/9zfdauxYO26vAEKCvIkbMo
|
35
|
+
7oq3V2q5Nl6MrZfXj2N07qe6/9zfdauxYO26vAEKCvIkbMo=
|
36
|
+
</X509Certificate>
|
36
37
|
</X509Data>
|
37
38
|
</KeyInfo>
|
38
39
|
</Signature></Envelope>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri-xmlsec-instructure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Albert J. Wong
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2025-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -25,6 +25,20 @@ dependencies:
|
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 1.11.2
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: appraisal
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: bundler
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,9 +154,11 @@ extensions:
|
|
140
154
|
- ext/nokogiri_ext_xmlsec/extconf.rb
|
141
155
|
extra_rdoc_files: []
|
142
156
|
files:
|
157
|
+
- ".github/workflows/push.yml"
|
143
158
|
- ".gitignore"
|
144
159
|
- ".rspec"
|
145
|
-
- ".
|
160
|
+
- ".tool-versions"
|
161
|
+
- Appraisals
|
146
162
|
- Gemfile
|
147
163
|
- Guardfile
|
148
164
|
- LICENSE.txt
|
@@ -163,6 +179,8 @@ files:
|
|
163
179
|
- ext/nokogiri_ext_xmlsec/util.c
|
164
180
|
- ext/nokogiri_ext_xmlsec/util.h
|
165
181
|
- ext/nokogiri_ext_xmlsec/xmlsecrb.h
|
182
|
+
- gemfiles/nokogiri_12.5.gemfile
|
183
|
+
- gemfiles/nokogiri_13.10.gemfile
|
166
184
|
- lib/nokogiri-xmlsec.rb
|
167
185
|
- lib/xmlsec.rb
|
168
186
|
- lib/xmlsec/version.rb
|
@@ -201,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
219
|
- !ruby/object:Gem::Version
|
202
220
|
version: '0'
|
203
221
|
requirements: []
|
204
|
-
rubygems_version: 3.
|
222
|
+
rubygems_version: 3.5.11
|
205
223
|
signing_key:
|
206
224
|
specification_version: 4
|
207
225
|
summary: Wrapper around http://www.aleksey.com/xmlsec to support XML encryption, decryption,
|
data/.travis.yml
DELETED