Skip to content

Commit

Permalink
80 cols
Browse files Browse the repository at this point in the history
  • Loading branch information
daaku committed Oct 20, 2010
1 parent 4c4782c commit e5e89dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion readme.md
Expand Up @@ -13,4 +13,5 @@ environment.
[mcrypt](http://php.net/mcrypt).
- Python requires [PyCrypto](http://www.dlitz.net/software/pycrypto/).
- Ruby requires [JSON](http://flori.github.com/json).
- Java requires [Apache Commons Codec](http://commons.apache.org/codec/), [json-simple](http://code.google.com/p/json-simple/).
- Java requires [Apache Commons Codec](http://commons.apache.org/codec/),
[json-simple](http://code.google.com/p/json-simple/).
3 changes: 2 additions & 1 deletion sample.rb
Expand Up @@ -23,7 +23,8 @@ def parse_signed_request(input, secret, max_age=3600)

raise 'Invalid request. (Invalid signature.)' \
if base64_url_decode(encoded_sig) !=
OpenSSL::HMAC.hexdigest('sha256', secret, encoded_envelope).split.pack('H*')
OpenSSL::HMAC.hexdigest(
'sha256', secret, encoded_envelope).split.pack('H*')

# for requests that are signed, but not encrypted, we're done
return envelope if algorithm == 'HMAC-SHA256'
Expand Down

0 comments on commit e5e89dc

Please sign in to comment.