Skip to content

Commit

Permalink
[Node 10] Update x509 (#130)
Browse files Browse the repository at this point in the history
* [Node 10] Update x509

* 4.0.0

* Update travis

* get rid of npm install
  • Loading branch information
Fady Makram authored Jun 14, 2019
1 parent 6e5bfce commit a33a0f0
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
.DS_Store
.vscode
package-lock.json
*.log
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: node_js
before_install: npm i -g [email protected]
node_js:
- 6
- 6
- 8
- 10
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "passport-wsfed-saml2",
"version": "3.0.17",
"version": "4.0.0",
"description": "SAML2 Protocol and WS-Fed library",
"scripts": {
"test": "mocha --reporter spec --recursive"
Expand All @@ -25,7 +25,7 @@
"passport-strategy": "^1.0.0",
"uid2": "0.0.x",
"valid-url": "^1.0.9",
"x509": "auth0/node-x509#v0.3.3-auth0",
"x509": "^0.3.4",
"xml-crypto": "auth0/xml-crypto#fix-digest",
"xml-encryption": "0.11.0",
"xml2js": "0.1.x",
Expand Down
11 changes: 7 additions & 4 deletions test/saml11.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,16 @@ describe('saml 1.1 assertion', function () {
};

const saml_passport = new SamlPassport(options);
const profile = saml_passport.validateSamlAssertion(signedAssertion, function(err, profile) {
let oldNpmMessage = 'The signing certificate is invalid (PEM_read_bio_PUBKEY failed)';
let newNpmMessage = 'The signing certificate is invalid (error:0906700D:PEM routines:PEM_ASN1_read_bio:ASN1 lib, error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error, error:0D068066:asn1 encoding routines:ASN1_CHECK_TLEN:bad object header)';
saml_passport.validateSamlAssertion(signedAssertion, function(err, profile) {
const errorMessages = [
'The signing certificate is invalid (PEM_read_bio_PUBKEY failed)',
'The signing certificate is invalid (error:0906700D:PEM routines:PEM_ASN1_read_bio:ASN1 lib, error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error, error:0D068066:asn1 encoding routines:ASN1_CHECK_TLEN:bad object header)',
'The signing certificate is invalid (error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error, error:0D068066:asn1 encoding routines:asn1_check_tlen:bad object header)'
];

assert.ok(err, 'The signing certificate was unexpectedly valid');
assert.ok(/signing certificate is invalid/.test(err.message), 'Error message is not the default invalid message');
assert.ok(err.message === oldNpmMessage || err.message === newNpmMessage, 'Error message for invalid certificate is incorrect');
assert.ok(errorMessages.includes(err.message), 'Error message for invalid certificate is incorrect');

done();
});
Expand Down
13 changes: 9 additions & 4 deletions test/saml20.tests.js

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

0 comments on commit a33a0f0

Please sign in to comment.