epics 2.1.0 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15557f467cdc9d8ca61665fc9c177001f95c668c6b05bab941223a630130e7f4
4
- data.tar.gz: b6177ec4c23c26641ddc48eb1b99478c49768e02a114d448769aa405bbe6bedc
3
+ metadata.gz: f91eb25c88880d2a09b23003cffc9601350a5c980e618945186177108917fdcb
4
+ data.tar.gz: aea9b65df7b8773a324cc8a8e457b96036e35f5cba7bf2aebc424183d9053b43
5
5
  SHA512:
6
- metadata.gz: ae3f679ae1b3d6a32851701716eca59ab4d17d9e3ef8f0f95ba7acd09ebb1c9f80750ee76f65e53596490b9aead1c89196c530515a8c40a19049c14d254fe8eb
7
- data.tar.gz: a4b9d40d66190362de7f68d11fbb178827980683c5d25323c9d48a6f15f5fa4dcce721f52e80b601a73f3877dee648042c2d95938ce597b91868317b050d8b7c
6
+ metadata.gz: 2559bbcbb940f957f21ec202d1fd67f766017426868c3413bba616aa438b904bbd8980e6f716274142e72707ca5166c34f8ac5ff23b4b996c4d49accc948ec07
7
+ data.tar.gz: '081d8491005d6c146b002d22c0a0f3fc90feb4c09d67cc406383ea8825c47e28d6579012d3e7b4ec754909ba60c65e5fbcdb6f7e145961a545160b89f53f84d9'
@@ -16,30 +16,30 @@ blocks:
16
16
  - name: Spec versions
17
17
  task:
18
18
  jobs:
19
- - name: "2.7"
19
+ - name: "3.0"
20
20
  commands:
21
21
  - checkout
22
- - sem-version ruby 2.7
22
+ - sem-version ruby 3.0
23
23
  - cache restore
24
- - gem install bundler:2.4.3
24
+ - gem install bundler:2.4.12
25
25
  - bundle install
26
26
  - cache store
27
27
  - bundle exec rspec
28
- - name: "3.0"
28
+ - name: "3.1"
29
29
  commands:
30
30
  - checkout
31
- - sem-version ruby 3.0
31
+ - sem-version ruby 3.1
32
32
  - cache restore
33
- - gem install bundler:2.4.3
33
+ - gem install bundler:2.4.12
34
34
  - bundle install
35
35
  - cache store
36
36
  - bundle exec rspec
37
- - name: "3.1"
37
+ - name: "3.2"
38
38
  commands:
39
39
  - checkout
40
- - sem-version ruby 3.1
40
+ - sem-version ruby 3.2
41
41
  - cache restore
42
- - gem install bundler:2.4.3
42
+ - gem install bundler:2.4.12
43
43
  - bundle install
44
44
  - cache store
45
45
  - bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 2.1.2
2
+
3
+ - [BUGFIX] Fix order data encryption for OpenSSL 3
4
+
5
+ ### 2.1.1
6
+
7
+ - [HOUSEKEEPING] update Bank public key initialization for OpenSSL 3
8
+
1
9
  ### 2.1.0
2
10
 
3
11
  - [HOUSEKEEPING] updates Nokogiri dependencies
data/README.md CHANGED
@@ -3,9 +3,11 @@
3
3
 
4
4
  # Epics
5
5
 
6
- EPICS is a ruby implementation of the [EBICS](http://www.ebics.org/) (Electronic Banking Internet
6
+ EPICS is a ruby implementation of the [EBICS](https://www.ebics.org/) (Electronic Banking Internet
7
7
  Communication Standard).
8
8
 
9
+ It supports EBICS 2.5.
10
+
9
11
  The client supports the complete initialization process comprising INI, HIA and HPB including the
10
12
  INI letter generation. It offers support for the most common download and upload order types
11
13
  (STA HAA HTD HPD PTK HAC HKD C52 C53 C54 CD1 CDB CDD CCT VMK).
data/epics.gemspec CHANGED
@@ -43,8 +43,9 @@ Gem::Specification.new do |spec|
43
43
  spec.add_dependency 'faraday', '>= 1.10.0'
44
44
  spec.add_dependency 'nokogiri', '>= 1.14.0'
45
45
  spec.add_dependency 'rubyzip', '>= 2.3.2'
46
+ spec.add_dependency 'rexml', '>= 3.2.5'
46
47
 
47
- spec.add_development_dependency 'bundler', '>= 2.4.3'
48
+ spec.add_development_dependency 'bundler', '>= 2.4.12'
48
49
  spec.add_development_dependency 'equivalent-xml'
49
50
  spec.add_development_dependency 'pry'
50
51
  spec.add_development_dependency 'rake', '~> 13.0'
data/lib/epics/client.rb CHANGED
@@ -105,13 +105,11 @@ class Epics::Client
105
105
  modulus = Base64.decode64(node.at_xpath(".//*[local-name() = 'Modulus']").content)
106
106
  exponent = Base64.decode64(node.at_xpath(".//*[local-name() = 'Exponent']").content)
107
107
 
108
- bank = OpenSSL::PKey::RSA.new
109
- if bank.respond_to?(:set_key)
110
- bank.set_key(OpenSSL::BN.new(modulus, 2), OpenSSL::BN.new(exponent, 2), nil)
111
- else
112
- bank.n = OpenSSL::BN.new(modulus, 2)
113
- bank.e = OpenSSL::BN.new(exponent, 2)
114
- end
108
+ sequence = []
109
+ sequence << OpenSSL::ASN1::Integer.new(OpenSSL::BN.new(modulus, 2))
110
+ sequence << OpenSSL::ASN1::Integer.new(OpenSSL::BN.new(exponent, 2))
111
+
112
+ bank = OpenSSL::PKey::RSA.new(OpenSSL::ASN1::Sequence(sequence).to_der)
115
113
 
116
114
  self.keys["#{host_id.upcase}.#{type}"] = Epics::Key.new(bank)
117
115
  end
@@ -1,15 +1,17 @@
1
1
  class Epics::GenericUploadRequest < Epics::GenericRequest
2
2
  attr_accessor :key
3
+ attr_accessor :iv
3
4
  attr_accessor :document
4
5
 
5
6
  def initialize(client, document)
6
7
  super(client)
7
8
  self.document = document
8
- self.key ||= cipher.random_key
9
+ self.key = cipher.random_key
10
+ self.iv = 0.chr * cipher.iv_len
9
11
  end
10
12
 
11
13
  def cipher
12
- @cipher ||= OpenSSL::Cipher.new("aes-128-cbc")
14
+ @cipher ||= OpenSSL::Cipher.new("aes-128-cbc").tap { |cipher| cipher.encrypt }
13
15
  end
14
16
 
15
17
  def digester
@@ -49,9 +51,9 @@ class Epics::GenericUploadRequest < Epics::GenericRequest
49
51
 
50
52
  def encrypt(d)
51
53
  cipher.reset
52
- cipher.encrypt
53
54
  cipher.padding = 0
54
55
  cipher.key = self.key
56
+ cipher.iv = self.iv
55
57
  (cipher.update(pad(d)) + cipher.final)
56
58
  end
57
59
 
data/lib/epics/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Epics
4
- VERSION = '2.1.0'
4
+ VERSION = '2.1.2'
5
5
  end
@@ -46,4 +46,13 @@ RSpec.describe Epics::GenericUploadRequest do
46
46
  end
47
47
 
48
48
  end
49
+
50
+ describe '#encrypted_order_data' do
51
+ it 'returns the same data every time' do
52
+ data_1 = subject.encrypted_order_data
53
+ data_2 = subject.encrypted_order_data
54
+
55
+ expect(data_1).to eq(data_2)
56
+ end
57
+ end
49
58
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epics
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Brillert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-25 00:00:00.000000000 Z
11
+ date: 2023-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -52,20 +52,34 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.3.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: rexml
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 3.2.5
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 3.2.5
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: bundler
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - ">="
60
74
  - !ruby/object:Gem::Version
61
- version: 2.4.3
75
+ version: 2.4.12
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - ">="
67
81
  - !ruby/object:Gem::Version
68
- version: 2.4.3
82
+ version: 2.4.12
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: equivalent-xml
71
85
  requirement: !ruby/object:Gem::Requirement