Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

provenance: attempt at manual EMSA-PKCS1-v1_5

  • Loading branch information...
commit 4dd0cb9ed30b65e10dc686f36a6980c51bfa4c4d 1 parent 8d98e9d
@astro authored
Showing with 86 additions and 76 deletions.
  1. +7 −2 lib/ostatus/salmon.js
  2. +68 −66 src/provenance.cc
  3. +11 −8 tests/test_salmon.js
View
9 lib/ostatus/salmon.js
@@ -149,12 +149,17 @@ function verifySignature(me, sig, pubKey) {
}
function base64url_decode(input) {
- return new Buffer(input.toString().replace(/-/g, '+').replace(/_/g, '/'), 'base64');
+ return new Buffer(input.toString().
+ replace(/-/g, '+').
+ replace(/_/g, '/'), 'base64');
}
// Encode to Base64url and removing padding (as per salmon spec)
function base64url_encode(input) {
- return new Buffer(input).toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
+ return new Buffer(input).toString('base64').
+ replace(/\+/g, '-').
+ replace(/\//g, '_').
+ replace(/\=/g, '');
}
exports.unpack = unpack;
View
134 src/provenance.cc
@@ -106,7 +106,7 @@ static Handle<Value> Generate(const Arguments &args) {
BN_hex2bn(&bn_e, "10001");
RSA *rsa = RSA_new();
- int status = RSA_generate_key_ex(rsa, 2048, bn_e, NULL);
+ int status = RSA_generate_key_ex(rsa, 1024, bn_e, NULL);
BN_free(bn_e);
if (!status) {
Local<Value> exception = Exception::Error(String::New("Cannot generate"));
@@ -135,6 +135,37 @@ static Handle<Value> Generate(const Arguments &args) {
}
/**
+ * Do not forget freeing result BIO
+ * @param k Modulus (n) byte count
+ */
+static BIO *EMSA_PKCS1_v1_5(Handle<Object> m, int k) {
+ const int hashLen = 256 / 8;
+ const int prefixLen = 19;
+
+ BIO *result = BIO_new(BIO_s_mem());
+ BIO_write(result, "\x00\x01", 2);
+
+ /* padding */
+ for(int i = 0; i < k - (prefixLen + hashLen); i++)
+ BIO_write(result, "\xFF", 1);
+ BIO_write(result, "\x00", 1);
+
+ const char prefix[] = { 0x30, 0x31, 0x30, 0xd, 0x6, 0x9, 0x60, 0x86,
+ 0x48, 0x1, 0x65, 0x3, 0x4, 0x2, 0x1, 0x5,
+ 0x0, 0x4, 0x20 };
+ BIO_write(result, prefix, prefixLen);
+
+ SHA256_CTX sha;
+ SHA256_Init(&sha);
+ SHA256_Update(&sha, Buffer::Data(m), Buffer::Length(m));
+ unsigned char mDigest[hashLen];
+ SHA256_Final(mDigest, &sha);
+ BIO_write(result, mDigest, hashLen);
+
+ return result;
+}
+
+/**
* @param {String or Buffer} Message
* @param {String or Buffer} Private key in RSAPrivateKey format
*/
@@ -145,7 +176,7 @@ static Handle<Value> SignRSASHA256(const Arguments &args) {
Local<Value> exception = Exception::TypeError(String::New("Bad argument"));
return ThrowException(exception);
}
- Handle<Value> m = args[0];
+ Handle<Object> m = args[0]->ToObject();
Handle<Value> privKey = args[1];
/* Prepare key */
@@ -156,53 +187,31 @@ static Handle<Value> SignRSASHA256(const Arguments &args) {
}
EVP_PKEY *pkey = PEM_read_bio_PrivateKey(bp, NULL, NULL, NULL);
- if (!pkey) {
+ if (!pkey || EVP_PKEY_type(pkey->type) != EVP_PKEY_RSA) {
Local<Value> exception = Exception::Error(String::New("Cannot read key"));
return ThrowException(exception);
}
-
BIO_free(bp);
+ RSA *rsa = EVP_PKEY_get1_RSA(pkey);
/* signing */
- const EVP_MD *md;
- md = EVP_get_digestbyname("RSA-SHA256");
- if (!md) {
- EVP_PKEY_free(pkey);
+ BIO *emsa = EMSA_PKCS1_v1_5(m, BN_num_bytes(rsa->n));
+ unsigned char *emsaData;
+ long emsaLen = BIO_get_mem_data(emsa, &emsaData);
- Local<Value> exception = Exception::Error(String::New("No RSA-SHA256 message digest"));
- return ThrowException(exception);
- }
+ int sigLen = RSA_size(rsa);
+ unsigned char sig[sigLen];
+ RSA_private_encrypt(emsaLen, emsaData, sig, rsa, RSA_NO_PADDING);
- EVP_MD_CTX mdctx;
- EVP_MD_CTX_init(&mdctx);
- EVP_SignInit_ex(&mdctx, md, NULL);
-
- /* TODO: for buffers, this could be zero-copy */
- ssize_t mLen = DecodeBytes(m);
- char *mBuf = new char[mLen];
- mLen = DecodeWrite(mBuf, mLen, m);
- EVP_SignUpdate(&mdctx, mBuf, mLen);
- delete[] mBuf;
-
- unsigned char *sig = new unsigned char[EVP_PKEY_size(pkey)];
- unsigned int sigLen;
- if (!EVP_SignFinal(&mdctx, sig, &sigLen, pkey)) {
- EVP_PKEY_free(pkey);
- delete[] sig;
- EVP_MD_CTX_cleanup(&mdctx);
-
- Local<Value> exception = Exception::Error(String::New("Cannot sign"));
- return ThrowException(exception);
- }
- printf("sig:");
+ BIO_free(emsa);
+ EVP_PKEY_free(pkey);
+
+ /*printf("sig:");
for(int i=0; i < sigLen;i++)
printf(" %02X",sig[i]);
- printf("\n");
+ printf("\n");*/
Handle<Value> sigResult = makeBuffer(sig, sigLen);
- EVP_PKEY_free(pkey);
- delete[] sig;
- EVP_MD_CTX_cleanup(&mdctx);
return scope.Close(sigResult);
}
@@ -219,46 +228,39 @@ static Handle<Value> VerifyRSASHA256(const Arguments &args) {
Local<Value> exception = Exception::TypeError(String::New("Bad argument"));
return ThrowException(exception);
}
- Handle<Value> m = args[0];
+ Handle<Object> m = args[0]->ToObject();
Handle<Object> sig = args[1]->ToObject();
Handle<Object> pubKey = args[2]->ToObject();
- /* Prepare verification */
- const EVP_MD *md = EVP_get_digestbyname("RSA-SHA256");
- if (!md) {
- Local<Value> exception = Exception::Error(String::New("No RSA-SHA256 message digest"));
- return ThrowException(exception);
- }
- EVP_MD_CTX mdctx;
- EVP_MD_CTX_init(&mdctx);
- EVP_VerifyInit_ex(&mdctx, md, NULL);
-
-
- /* Write data */
- /* TODO: for buffers, this could be zero-copy */
- ssize_t mLen = DecodeBytes(m);
- char *mBuf = new char[mLen];
- mLen = DecodeWrite(mBuf, mLen, m);
- EVP_VerifyUpdate(&mdctx, mBuf, mLen);
- delete[] mBuf;
-
/* Prepare key */
RSA *rsa = RSA_new();
Handle<Value> n = pubKey->Get(String::NewSymbol("n"));
rsa->n = binaryToBn(n);
Handle<Value> e = pubKey->Get(String::NewSymbol("e"));
rsa->e = binaryToBn(e);
- EVP_PKEY *pkey = EVP_PKEY_new();
- EVP_PKEY_set1_RSA(pkey, rsa);
- /* Pass sig */
- /*printf("vsig:");
- for(int i=0; i < sigLen;i++)
- printf(" %02X",sigBuf[i]);
- printf("\n");*/
- int status = EVP_VerifyFinal(&mdctx, (unsigned char *)Buffer::Data(sig), Buffer::Length(sig), pkey);
+ /* Prepare data */
+ BIO *emsa = EMSA_PKCS1_v1_5(m, BN_num_bytes(rsa->n));
+ unsigned char *emsaData;
+ long emsaLen = BIO_get_mem_data(emsa, &emsaData);
- EVP_PKEY_free(pkey);
+ int rsigLen = RSA_size(rsa);
+ unsigned char rsig[rsigLen];
+ RSA_public_decrypt(emsaLen, emsaData, rsig, rsa, RSA_NO_PADDING);
+
+ BIO_free(emsa);
+ RSA_free(rsa);
+
+ /* Pass sig */
+ printf("rsig:");
+ for(int i=0; i < rsigLen;i++)
+ printf(" %02X",rsig[i]);
+ printf("\n");
+ printf("vsig:");
+ for(int i=0; i < Buffer::Length(sig);i++)
+ printf(" %02X",((unsigned char *)Buffer::Data(sig))[i]);
+ printf("\n");
+ int status = 0;
switch(status) {
case 1:
View
19 tests/test_salmon.js
@@ -30,11 +30,11 @@ console.log({sign:[this.me,this.key.private]})
'can be verified': {
topic: function() {
console.log({verify:[this.me,this.sig,this.key.public]})
- this.verified = Salmon.verifySignature(this.me, this.sig, this.key.public);
+ this.verified1 = Salmon.verifySignature(this.me, this.sig, this.key.public);
this.callback();
},
'verification successful': function() {
- Assert.ok(this.verified);
+ Assert.ok(this.verified1);
}
}
}
@@ -45,7 +45,7 @@ console.log({verify:[this.me,this.sig,this.key.public]})
'should work': {
topic: function() {
var pubKey = "RSA.mVgY8RN6URBTstndvmUUPb4UZTdwvwmddSKE5z_jvKUEK6yk1u3rrC9yN8k6FilGj9K0eeUPe2hf4Pj-5CmHww.AQAB";
- var sig = "EvGSD2vi8qYcveHnb-rrlok07qnCXjn8YSeCDDXlbhILSabgvNsPpbe76up8w63i2fWHvLKJzeGLKfyHg8ZomQ";
+ /*var sig = "EvGSD2vi8qYcveHnb-rrlok07qnCXjn8YSeCDDXlbhILSabgvNsPpbe76up8w63i2fWHvLKJzeGLKfyHg8ZomQ";
var data = "PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4KPGVudHJ5IHhtbG5zPS" +
"dodHRwOi8vd3d3LnczLm9yZy8yMDA1L0F0b20nPgogIDxpZD50YWc6ZXhhbXBsZS5jb20s" +
"MjAwOTpjbXQtMC40NDc3NTcxODwvaWQ-ICAKICA8YXV0aG9yPjxuYW1lPnRlc3RAZXhhbX" +
@@ -57,15 +57,18 @@ console.log({verify:[this.me,this.sig,this.key.public]})
"TY2MzI1ODUzODg1Nzk1NAogIDwvdGhyOmluLXJlcGx5LXRvPgogIDxjb250ZW50PlNhbG1" +
"vbiBzd2ltIHVwc3RyZWFtITwvY29udGVudD4KICA8dGl0bGUU2FsbW9uIHN3aW0gdXBzdH" +
"JlYW0hPC90aXRsZT4KICA8dXBkYXRlZD4yMDA5LTEyLTE4VDIwOjA0OjAzWjwvdXBkYXRl" +
- "ZD4KPC9lbnRyeT4KICAgIA";
+ "ZD4KPC9lbnRyeT4KICAgIA";*/
+ var sig = "UqKwh0XSOhdSD7U9nVHxB67sCNt8lQzkl5aPELQTfuhrlBoktbExhhkP4QGFg0WS0FgPnQpG24z5S4XIk2BTjI8My-VlwRWdeU72NtnLhZjz8EzA1aJTI_Drs71-YICuM_dLAJgo55pF4nIMkRN9KA-rS-y7oC3cwt01MknR8UQ=";
+ var data = "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiID8-PGVudHJ5IHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDA1L0F0b20iIHhtbG5zOnRocj0iaHR0cDovL3B1c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6bm90aWNlX2luZm8-CjwvZW50cnk-Cg==";
var data_type = "application/atom+xml";
- this.verified = Salmon.verifySignature({ data: Salmon.base64url_decode(data),
- data_type: data_type },
- Salmon.base64url_decode(sig), pubKey);
+console.log({dsig:Salmon.base64url_decode(sig),data:Salmon.base64url_decode(data).toString()});
+ this.verified2 = Salmon.verifySignature({ data: Salmon.base64url_decode(data),
+ data_type: data_type },
+ Salmon.base64url_decode(sig), pubKey);
this.callback();
},
verifies: function() {
- Assert.ok(this.verified);
+ Assert.ok(this.verified2);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.