mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1027595 - TypeError: deriveHawkCredentials is not a function after bug 1020859. r=jedp
This commit is contained in:
parent
4924bb2340
commit
7746ac6a1d
@ -117,13 +117,16 @@ HAWKAuthenticatedRESTRequest.prototype = {
|
||||
* extra: size - 64 extra bytes (if size > 64)
|
||||
* }
|
||||
*/
|
||||
function deriveHawkCredentials(tokenHex, context, size=96) {
|
||||
this.deriveHawkCredentials = function deriveHawkCredentials(tokenHex,
|
||||
context,
|
||||
size = 96,
|
||||
hexKey = false) {
|
||||
let token = CommonUtils.hexToBytes(tokenHex);
|
||||
let out = CryptoUtils.hkdf(token, undefined, Credentials.keyWord(context), size);
|
||||
|
||||
let result = {
|
||||
algorithm: "sha256",
|
||||
key: out.slice(32, 64),
|
||||
key: hexKey ? CommonUtils.bytesAsHex(out.slice(32, 64)) : out.slice(32, 64),
|
||||
id: CommonUtils.bytesAsHex(out.slice(0, 32))
|
||||
};
|
||||
if (size > 64) {
|
||||
|
@ -106,7 +106,7 @@ this.MobileIdentityClient.prototype = {
|
||||
*/
|
||||
_deriveHawkCredentials: function(aSessionToken) {
|
||||
return deriveHawkCredentials(aSessionToken, CREDENTIALS_DERIVATION_INFO,
|
||||
CREDENTIALS_DERIVATION_SIZE);
|
||||
CREDENTIALS_DERIVATION_SIZE, true /*hexKey*/);
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user