mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2025-01-10 07:19:27 -07:00
Fix signature profile generation
This commit is contained in:
parent
f51afd2ead
commit
e5265a899d
1 changed files with 6 additions and 4 deletions
|
@ -138,7 +138,9 @@ const fetchSignature = (signature) => {
|
||||||
// Check validity of signature
|
// Check validity of signature
|
||||||
let signatureData
|
let signatureData
|
||||||
try {
|
try {
|
||||||
signatureData = await openpgp.cleartext.readArmored(signature)
|
signatureData = await openpgp.readCleartextMessage({
|
||||||
|
cleartextMessage: signature
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
reject(new Error(`Signature could not be properly read (${error.message})`))
|
reject(new Error(`Signature could not be properly read (${error.message})`))
|
||||||
}
|
}
|
||||||
|
@ -161,10 +163,10 @@ const fetchSignature = (signature) => {
|
||||||
// Check validity of signature
|
// Check validity of signature
|
||||||
const verified = await openpgp.verify({
|
const verified = await openpgp.verify({
|
||||||
message: signatureData,
|
message: signatureData,
|
||||||
publicKeys: output.publicKey
|
verificationKeys: output.publicKey
|
||||||
})
|
})
|
||||||
const { valid } = verified.signatures[0]
|
|
||||||
if (!valid) {
|
if (!await verified.signatures[0].verified) {
|
||||||
reject(new Error('Signature was invalid'))
|
reject(new Error('Signature was invalid'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue