update script

This commit is contained in:
Adora Laura Kalb 2023-08-18 23:43:50 +02:00
parent e28dfbe603
commit 3e8cea2da1
Signed by: adoralaura
GPG key ID: 7A4552166FC8C056

View file

@ -13,12 +13,14 @@ async function submitForm() {
var admin = "notadmin" var admin = "notadmin"
var string = `${nonce.nonce}\0${username}\0${password}\0${admin}` var string = `${nonce.nonce}\0${username}\0${password}\0${admin}`
console.log("String: ", string)
const hasher = new jsSHA("SHA-1", "TEXT", { hmacKey : { value : sharedsecret, format: "TEXT" }}) const hasher = new jsSHA("SHA-1", "TEXT", { hmacKey : { value : sharedsecret, format: "TEXT" }})
hasher.update(string) hasher.update(string)
var hmac = hasher.getHash('HEX') var hmac = hasher.getHash('HEX')
console.log("HMAC: ", hmac)
var register_body = JSON.stringify({ var register_body = JSON.stringify({
"nonce": nonce.nonce, "nonce": nonce.nonce,
"username": displayname, "username": displayname,
@ -33,7 +35,8 @@ async function submitForm() {
body: register_body body: register_body
}) })
console.log(await register_request.statusText)
} }
function HandlePasswordInput() { function HandlePasswordInput() {