dibs_hmac 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +6 -0
- data/VERSION +1 -1
- data/dibs_hmac.gemspec +6 -4
- data/lib/dibs/hmac.rb +2 -2
- data/spec/dibs/hmac_spec.rb +2 -2
- metadata +17 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8cdf2315181bd560efd1859a088e5367ad797a4
|
4
|
+
data.tar.gz: b82640e561de710d469f81be3b3e265b14b744be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0356e974cf6a98e2f5d17cba4e86044cff67082bd6009235570452497eb88553e7a6be91f920e69e39c012314c19f2c704621066ca6fcfb0346c64789494a269
|
7
|
+
data.tar.gz: ee5a8ec557c9cd6488e982823ded2bc216d8d0768aaa20cad64fc617e7a5bd2f22be43f8f09dd7828a20f87f0137f03573af198312e6e3d0c624d93d21085a34
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -7,6 +7,12 @@ An implementation of DIBS Message authentication code. Has correct sorting and r
|
|
7
7
|
|
8
8
|
If you find this useful please tell me in an email.
|
9
9
|
|
10
|
+
## Short changelog
|
11
|
+
|
12
|
+
# 0.1.3 (2015-08-24)
|
13
|
+
|
14
|
+
- Remove deprecation warnings and added support for newer ruby versions.
|
15
|
+
|
10
16
|
## Code example
|
11
17
|
|
12
18
|
### Calculate mac
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/dibs_hmac.gemspec
CHANGED
@@ -2,25 +2,27 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: dibs_hmac 0.1.
|
5
|
+
# stub: dibs_hmac 0.1.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "dibs_hmac"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Bj\u{f6}rn Blomqvist"]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2015-08-24"
|
15
15
|
s.description = "An implementation of DIBS Message authentication code. Has correct sorting and rules for which params to include. So far it only includes the params for DIBS Payment Window."
|
16
16
|
s.email = "bjorn@bjornblomqvist.se"
|
17
17
|
s.extra_rdoc_files = [
|
18
|
+
"CHANGELOG.md",
|
18
19
|
"LICENSE.txt",
|
19
20
|
"README.md"
|
20
21
|
]
|
21
22
|
s.files = [
|
22
23
|
".document",
|
23
24
|
".rspec",
|
25
|
+
"CHANGELOG.md",
|
24
26
|
"Gemfile",
|
25
27
|
"LICENSE.txt",
|
26
28
|
"README.md",
|
@@ -34,7 +36,7 @@ Gem::Specification.new do |s|
|
|
34
36
|
]
|
35
37
|
s.homepage = "http://github.com/bjornblomqvist/dibs_hmac"
|
36
38
|
s.licenses = ["LGPL"]
|
37
|
-
s.rubygems_version = "2.
|
39
|
+
s.rubygems_version = "2.4.6"
|
38
40
|
s.summary = "An implementation of DIBS Message authentication code."
|
39
41
|
|
40
42
|
if s.respond_to? :specification_version then
|
data/lib/dibs/hmac.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'openssl'
|
2
2
|
|
3
3
|
module DIBS
|
4
4
|
class HMAC
|
@@ -81,7 +81,7 @@ module DIBS
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
OpenSSL::HMAC.hexdigest(OpenSSL::Digest
|
84
|
+
OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'),Array(key).pack('H*'), param_string)
|
85
85
|
end
|
86
86
|
|
87
87
|
def self.valid?(params, key)
|
data/spec/dibs/hmac_spec.rb
CHANGED
@@ -45,14 +45,14 @@ describe DIBS::HMAC do
|
|
45
45
|
it 'should be true' do
|
46
46
|
|
47
47
|
mac = "9c4d30a74ade9f93dfeca46edbdac110c8ec9b250185aab25a4555b3575d3ddc"
|
48
|
-
subject.valid?({:amount => "100", :merchant => "2222", :MAC => mac}, hmac_key).should
|
48
|
+
subject.valid?({:amount => "100", :merchant => "2222", :MAC => mac}, hmac_key).should be_truthy
|
49
49
|
|
50
50
|
end
|
51
51
|
|
52
52
|
it 'should be false' do
|
53
53
|
|
54
54
|
mac = "9c4d30a74ade9f93dfeca46edbdac110c8ec9b250185aab25a4555b3575d3ddc"
|
55
|
-
subject.valid?({:amount => "100", :MAC => mac}, hmac_key).should
|
55
|
+
subject.valid?({:amount => "100", :MAC => mac}, hmac_key).should be_falsey
|
56
56
|
|
57
57
|
end
|
58
58
|
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dibs_hmac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Björn Blomqvist
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.8'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.8'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rdoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '3.12'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3.12'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: jeweler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '1.8'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.8'
|
69
69
|
description: An implementation of DIBS Message authentication code. Has correct sorting
|
@@ -73,11 +73,13 @@ email: bjorn@bjornblomqvist.se
|
|
73
73
|
executables: []
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files:
|
76
|
+
- CHANGELOG.md
|
76
77
|
- LICENSE.txt
|
77
78
|
- README.md
|
78
79
|
files:
|
79
|
-
- .document
|
80
|
-
- .rspec
|
80
|
+
- ".document"
|
81
|
+
- ".rspec"
|
82
|
+
- CHANGELOG.md
|
81
83
|
- Gemfile
|
82
84
|
- LICENSE.txt
|
83
85
|
- README.md
|
@@ -98,17 +100,17 @@ require_paths:
|
|
98
100
|
- lib
|
99
101
|
required_ruby_version: !ruby/object:Gem::Requirement
|
100
102
|
requirements:
|
101
|
-
- -
|
103
|
+
- - ">="
|
102
104
|
- !ruby/object:Gem::Version
|
103
105
|
version: '0'
|
104
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
107
|
requirements:
|
106
|
-
- -
|
108
|
+
- - ">="
|
107
109
|
- !ruby/object:Gem::Version
|
108
110
|
version: '0'
|
109
111
|
requirements: []
|
110
112
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.4.6
|
112
114
|
signing_key:
|
113
115
|
specification_version: 4
|
114
116
|
summary: An implementation of DIBS Message authentication code.
|