Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed PasswordDigest Generation (#1039)
* Fixed PasswordDigest Generation The WSSE password digest is best calculated from a byte array of the concat of NONCE, CREATED TIMESTAMP and PASSWORD * Added testing for PasswordDigest * Update server-compress-test.js Refactored to ensure the server is running before the test runs * Update utils.js Porting to the Buffer.from()
- Loading branch information
1 parent
570f5b3
commit f4fd1e7
Showing
4 changed files
with
112 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
var Utils = require('../../lib/utils'), | ||
assert = require('assert'); | ||
|
||
describe('PasswordDigest', function () { | ||
|
||
var nonce = "2FW1CIo2ZUOJmSjVRcJZlQ=="; | ||
var created = "2019-02-12T12:34:12.110Z"; | ||
var password = "vM3s1hKVMy6zBOn"; | ||
var expected = "wM9xjA92wCw+QcQI1urjZ6B8+LQ="; | ||
|
||
it('is a function', function () { | ||
Utils.passwordDigest.should.be.type('function'); | ||
}); | ||
|
||
it('should calculate a valid passworddigest ', function () { | ||
|
||
var result = Utils.passwordDigest(nonce, created, password); | ||
assert.equal(result, expected); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters