Skip to content

Commit

Permalink
Fixed package.json dep and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnou committed Mar 27, 2011
1 parent eeda977 commit 87c589a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions lib/ostatus/salmon.js
Expand Up @@ -32,7 +32,7 @@ var Sys = require('sys'),
Mu = require('mu');
Base64 = require('base64');
Crypto = require('crypto');
Rsa = require('rsa');
Bn = require('bignumber');
Buffer = require('buffer').Buffer;

function unpack(body, callback) {
Expand Down Expand Up @@ -72,19 +72,19 @@ function verify_signature(me, key) {
var hash = sha256.digest('hex');

// Decode the signature from the base64url encoded value we have in the envelope
var sig = Rsa.b64toBA(me.sigs[0].value.replace(/-/g, '+').replace(/_/g, '/'));
var sig = Bn.b64toBA(me.sigs[0].value.replace(/-/g, '+').replace(/_/g, '/'));

// Extract the key elements from the key encoding
var key = key.replace(/-/g, '+').replace(/_/g, '/').split('.');
var n = Rsa.b64tohex(key[1]);
var n = Bn.b64tohex(key[1]);
var e = "10001"; //Rsa.b64tohex(key[2]);

// Prepare the RSA Engine
var rsa = new Rsa.Key();
var rsa = new Bn.Key();
rsa.setPublic(n, e);

// Perform RSA Public on the signature string
var v = rsa.doPublic(new Rsa.BigInteger(sig));
var v = rsa.doPublic(new Bn.BigInteger(sig));

// Convert the verified output into a string and keep the last 64 characters
var buf = new Buffer(v.toByteArray());
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -13,5 +13,6 @@
,"o3-xml" : "http://files.eschnou.com/o3-xml.tgz"
,"flow" : "0.2.x"
,"base64" : "2.0.x"
,"bignumber" : "1.1.x"
}
}
1 change: 0 additions & 1 deletion tests/test-openssl.js
Expand Up @@ -2,7 +2,6 @@ var assert=require('assert');
var fs=require('fs');
var path=require('path');
var ostatus=require('ostatus');
var rsa=require('rsa');

/*
* Test interoperability with an OpenSSL signed salmon magic enveloppe.
Expand Down
3 changes: 1 addition & 2 deletions tests/test-statusnet.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 87c589a

Please sign in to comment.