ostatus2 2.0.0 → 2.0.1

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
  SHA1:
3
- metadata.gz: '0594abb740fddf0384530828f2b967ce16825337'
4
- data.tar.gz: 919ce48e3f4d2fffca662c1cc8feb439b4f927ef
3
+ metadata.gz: 5b10dcbd38df486eac9b8bb7a362ff9be8ae8bf9
4
+ data.tar.gz: 4f44adbb73150983a99b3b00a381e800623fea20
5
5
  SHA512:
6
- metadata.gz: 0efa9b1dfb6b14b396cdd93473422e6bef36fbbd902331a2311cc2f3ceed5cfc0c27ed2d071fb347759344d2c9d3e994fa317da11f51f9cf68c556584edde492
7
- data.tar.gz: 64c872ce4d9ef4e8854f85d8bdb870ae33d43004e70d06935045a3d92eb12c357e37353219e3a81d61609a21927ce3534066270564ec5bc21763f7dc1f12a81f
6
+ metadata.gz: fed4ccc8d261898df3ae2769c08024e596727097ef1940eb86918e8f1c52a2c19ee521e9173a26aa43e07ea6d6d0111923c5c5e312946ce6760db40298d50c57
7
+ data.tar.gz: b26357250a0283f4f57a4cb087b7a81ec29c22dfd2d1cf3e7ff6d53ca6f8c961d96cc94951429a72395971af28bc379e68c7ef715975dfc1e3b1c8c56354b1ad
@@ -70,9 +70,9 @@ module OStatus2
70
70
 
71
71
  data = xml.at_xpath('//me:data', me: XMLNS)
72
72
  type = data.attribute('type').value
73
- body = decode_base64(data.content)
73
+ body = decode_base64(data.content.gsub(/\s+/, ''))
74
74
  sig = xml.at_xpath('//me:sig', me: XMLNS)
75
- signature = decode_base64(sig.content)
75
+ signature = decode_base64(sig.content.gsub(/\s+/, ''))
76
76
  encoding = xml.at_xpath('//me:encoding', me: XMLNS).content
77
77
  alg = xml.at_xpath('//me:alg', me: XMLNS).content
78
78
  plaintext = plaintext_signature(body, type, encoding, alg)
@@ -44,7 +44,7 @@ module OStatus2
44
44
  # @return [Boolean]
45
45
  def verify(content, signature)
46
46
  hmac = OpenSSL::HMAC.hexdigest('sha1', @secret, content)
47
- signature == "sha1=#{hmac}"
47
+ signature.downcase == "sha1=#{hmac}"
48
48
  end
49
49
 
50
50
  private
@@ -1,3 +1,3 @@
1
1
  module OStatus2
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ostatus2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugen Rochko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-04 00:00:00.000000000 Z
11
+ date: 2017-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: openssl