internal: incomplete vault systems behind feature flag (#2340)

This commit is contained in:
Mo
2023-06-30 09:01:56 -05:00
committed by GitHub
parent d16e401bb9
commit b032eb9c9b
638 changed files with 20321 additions and 4813 deletions

View File

@@ -158,8 +158,39 @@ export default class FakeWebCrypto {
return data.message
}
sodiumCryptoBoxGenerateKeypair() {
return { publicKey: this.randomString(64), privateKey: this.randomString(64), keyType: 'x25519' }
sodiumCryptoSign(message, secretKey) {
const data = {
message,
secretKey,
}
return btoa(JSON.stringify(data))
}
sodiumCryptoKdfDeriveFromKey(key, subkeyNumber, subkeyLength, context) {
return btoa(key + subkeyNumber + subkeyLength + context)
}
sodiumCryptoGenericHash(message, key) {
return btoa(message + key)
}
sodiumCryptoSignVerify(message, signature, publicKey) {
return true
}
sodiumCryptoBoxSeedKeypair(seed) {
return {
privateKey: seed,
publicKey: seed,
}
}
sodiumCryptoSignSeedKeypair(seed) {
return {
privateKey: seed,
publicKey: seed,
}
}
generateOtpSecret() {