nokogiri-xmlsec-instructure 0.10.1 → 0.10.2
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 -0
- 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
- 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: 81d08ea19b4230b07f26533b8dc8d556a889e207a2a6194575231c5cf0aae318
|
4
|
+
data.tar.gz: '09595d365865a363d7395dec3289976fb852bf8dad138e497b40d1138f486083'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bf88cdf158f4766183b1e82bdcd4d68411caa0542773f5327a1d2cf74f04c3e7444a446d8bb3088cac4be596d2a61ffcdec85ca781a8078d00a7690c0c773a0
|
7
|
+
data.tar.gz: '02939e5f9cce8e6cc15f49befa60956ea9b72a0a461d7ee0c886233ca21795083e946a8140a83e1c5c317a7e3006d3bc1ab1bd689e414be0795bb5540691d6a4'
|
@@ -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
|
@@ -22,6 +23,12 @@ puts "Ensure we escaping: #{$CFLAGS}"
|
|
22
23
|
'-DXMLSEC_CRYPTO=\\"openssl\\"'
|
23
24
|
end
|
24
25
|
|
26
|
+
$CFLAGS << Dir[Gem.loaded_specs['nokogiri'].full_gem_path + "/ext/*"].map { |dir| " -I#{dir}"}.join("")
|
27
|
+
|
25
28
|
puts "Clfags: #{$CFLAGS}"
|
26
29
|
$libs = `xmlsec1-config --libs`.strip
|
30
|
+
|
31
|
+
# We reference symbols out of nokogiri but don't link directly against it
|
32
|
+
$LDFLAGS << ' -Wl,-undefined,dynamic_lookup'
|
33
|
+
|
27
34
|
create_makefile('nokogiri_ext_xmlsec')
|
@@ -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"
|
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.2
|
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: 2022-12-13 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.2.
|
222
|
+
rubygems_version: 3.2.33
|
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