From 3d7f1ce11a4bf5da8358b3049f738e0382ce8c21 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Fri, 22 Sep 2023 10:22:35 +0200 Subject: [PATCH] fix: make hash utils aware of ASPE --- static-src/ui.js | 12 ++++++------ views/util/argon2.pug | 2 +- views/util/bcrypt.pug | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/static-src/ui.js b/static-src/ui.js index 61d35f6..dda2fee 100644 --- a/static-src/ui.js +++ b/static-src/ui.js @@ -337,8 +337,8 @@ const runArgon2GenerationUtility = () => { elFeedback.innerHTML = ""; } else { let feedbackContent = ""; - if (!(/openpgp4fpr:[0-9a-zA-Z]+/.test(elInput.value))) { - feedbackContent += "❗ Valid proofs must begin with openpgp4fpr:.
"; + if (!(/[openpgp4fpr|aspe]:[0-9a-zA-Z]+/.test(elInput.value))) { + feedbackContent += "❗ Valid OpenPGP proofs must begin with openpgp4fpr:.
"; } if (!(elInput.value === elInput.value.toLowerCase())) { feedbackContent += "❗ Valid proofs must be lowercase.
"; @@ -379,7 +379,7 @@ window.kx__fixArgon2Input = () => { const elInput = document.querySelector('#form-util-argon2-generate .input'); elInput.value = elInput.value.toLowerCase(); - if (!(/openpgp4fpr:[0-9a-zA-Z]+/.test(elInput.value))) { + if (!(/[openpgp4fpr|aspe]:[0-9a-zA-Z]+/.test(elInput.value))) { elInput.value = `openpgp4fpr:${elInput.value}`; } @@ -402,8 +402,8 @@ const runBcryptGenerationUtility = () => { elFeedback.innerHTML = ""; } else { let feedbackContent = ""; - if (!(/openpgp4fpr:[0-9a-zA-Z]+/.test(elInput.value))) { - feedbackContent += "❗ Valid proofs must begin with openpgp4fpr:.
"; + if (!(/[openpgp4fpr|aspe]:[0-9a-zA-Z]+/.test(elInput.value))) { + feedbackContent += "❗ Valid OpenPGP proofs must begin with openpgp4fpr:.
"; } if (!(elInput.value === elInput.value.toLowerCase())) { feedbackContent += "❗ Valid proofs must be lowercase.
"; @@ -444,7 +444,7 @@ window.kx__fixBcryptInput = () => { const elInput = document.querySelector('#form-util-bcrypt-generate .input'); elInput.value = elInput.value.toLowerCase(); - if (!(/openpgp4fpr:[0-9a-zA-Z]+/.test(elInput.value))) { + if (!(/[openpgp4fpr|aspe]:[0-9a-zA-Z]+/.test(elInput.value))) { elInput.value = `openpgp4fpr:${elInput.value}`; } diff --git a/views/util/argon2.pug b/views/util/argon2.pug index d7189b7..f4023f7 100644 --- a/views/util/argon2.pug +++ b/views/util/argon2.pug @@ -11,7 +11,7 @@ block content a(href='https://en.wikipedia.org/wiki/Argon2') Argon2 | hashes useful to a(href='https://docs.keyoxide.org/understanding-keyoxide/identity-proof-formats/#Hashed_URI') conceal identity proofs - | . Be sure to include "openpgp4fpr:" for a valid proof! + | . Be sure to include "openpgp4fpr:" for a valid OpenPGP proof! For ASP, enter the entire URI beginning with "aspe:". h3 Input input.input.half-width(type='text' name='input' placeholder='openpgp4fpr:…' value=input) h3 Hash diff --git a/views/util/bcrypt.pug b/views/util/bcrypt.pug index 90d6f84..e3fafa9 100644 --- a/views/util/bcrypt.pug +++ b/views/util/bcrypt.pug @@ -11,7 +11,7 @@ block content a(href='https://en.wikipedia.org/wiki/Bcrypt') bcrypt | hashes useful to a(href='https://docs.keyoxide.org/understanding-keyoxide/identity-proof-formats/#Hashed_URI') conceal identity proofs - | . Be sure to include "openpgp4fpr:" for a valid proof! + | . Be sure to include "openpgp4fpr:" for a valid OpenPGP proof! For ASP, enter the entire URI beginning with "aspe:". h3 Input input.input.half-width(type='text' name='input' placeholder='openpgp4fpr:…' value=input) h3 Hash