Skip to content

Commit

Permalink
Merge pull request #2 from unravelin/december
Browse files Browse the repository at this point in the history
Month range check should allow 12
  • Loading branch information
icio committed Jun 1, 2018
2 parents 0c10b68 + c0d1d39 commit 553def3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ravelinjs",
"version": "0.0.2",
"version": "0.0.3",
"description": "Ravelin Browser Card Encryption Library.",
"main": "ravelin.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions ravelin.js
Expand Up @@ -9,7 +9,7 @@
}
}(typeof self !== 'undefined' ? self : this, function () {

var version = '0.0.2';
var version = '0.0.3';

var RSAKey = (function(){
// prng4.js - uses Arcfour as a PRNG
Expand Down Expand Up @@ -965,7 +965,7 @@
if (typeof details.month == 'string') {
details.month = parseInt(details.month, 10);
}
if (!(details.month > 0 && details.month < 12)) {
if (!(details.month > 0 && details.month < 13)) {
throw new Error("RavelinJS validation: month should be in the range 1-12");
}

Expand Down Expand Up @@ -1011,4 +1011,4 @@

RavelinJS.RavelinJS = RavelinJS;
return new RavelinJS();
}));
}));
4 changes: 2 additions & 2 deletions test/test.js
Expand Up @@ -60,7 +60,7 @@ describe('ravelinjs', function() {
c.cardCiphertext != "" && c.cardCiphertext.length > 10 &&
c.aesKeyCiphertext != "" && c.aesKeyCiphertext.length > 10 &&
c.algorithm == "RSA_WITH_AES_256_GCM" &&
c.ravelinjsVersion == "0.0.2"
c.ravelinjsVersion == "0.0.3"
);
}

Expand All @@ -78,7 +78,7 @@ describe('ravelinjs', function() {

expect(ravelin.encrypt({
pan: '4111 1111 1111 1111',
month: "10",
month: "12",
year: "20",
})).to.satisfy(validCipher);
});
Expand Down

0 comments on commit 553def3

Please sign in to comment.