Skip to content

Commit

Permalink
use a subset of type UserDto for fingerprint calc
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Jun 29, 2024
1 parent 6e10cc0 commit 03cfd71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion frontend/src/common/wot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async function verifyRescursive(signatureChain: string[], signerPublicKey: Crypt
* @param user The user whose fingerprint to compute
* @returns Hexadecimal representation of the fingerprint
*/
async function computeFingerprint(user: UserDto) {
async function computeFingerprint(user: { ecdhPublicKey?: string; ecdsaPublicKey?: string }) {
if (!user.ecdhPublicKey || !user.ecdsaPublicKey) {
throw new Error('User has no public keys');
}
Expand Down
12 changes: 1 addition & 11 deletions frontend/src/components/AuditLogDetailsSignedWotId.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,7 @@ onMounted(async () => {
try {
const signerPublicKey = await asPublicKey(base64.parse(props.event.signerKey), UserKeys.ECDSA_KEY_DESIGNATION, UserKeys.ECDSA_PUB_KEY_USAGES);
const [_, signedKeys] = await JWT.parse(props.event.signature, signerPublicKey) as [JWTHeader, SignedKeys];
const signedUser: UserDto = {
id: props.event.userId,
type: 'USER',
email: '', // irrelevant for this purpose
name: '', // irrelevant for this purpose
devices: [], // irrelevant for this purpose
accessibleVaults: [], // irrelevant for this purpose
ecdhPublicKey: signedKeys.ecdhPublicKey,
ecdsaPublicKey: signedKeys.ecdsaPublicKey
};
signedFingerprint.value = await wot.computeFingerprint(signedUser);
signedFingerprint.value = await wot.computeFingerprint({ecdhPublicKey: signedKeys.ecdhPublicKey, ecdsaPublicKey: signedKeys.ecdsaPublicKey});
if (props.event.signerKey === signingUser?.ecdsaPublicKey && signedFingerprint.value === currentFingerprint.value) {
signatureStatus.value = SignatureStatus.STILL_VALID;
} else if (props.event.signerKey !== signingUser?.ecdsaPublicKey) {
Expand Down

0 comments on commit 03cfd71

Please sign in to comment.