You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicstaticlastSig=async(key: Key): Promise<number>=>{leti=0;console.log(`Key OUID ${(Objectasany).__oid(key)}`);awaitkey.getExpirationTime();// will force all sigs to be verifiedconstallSignatures: SignaturePacket[]=[];for(constuserofkey.users){i=0;for(constsigofuser.selfCertifications){console.log(`user ${user.userID?.email} sig[${i++}](OUID ${(Objectasany).__oid(sig)} => ${sig.verified})\n`);}allSignatures.push(...user.selfCertifications);}i=0;for(constsubKeyofkey.subkeys){i=0;for(constsigofsubKey.bindingSignatures){console.log(`subkey ${subKey.getKeyID().toHex()} sig[${i++}](OUID ${(Objectasany).__oid(sig)} => ${sig.verified})}\n`);}allSignatures.push(...subKey.bindingSignatures);}allSignatures.sort((a,b)=>(b.created ? b.created.getTime() : 0)-(a.created ? a.created.getTime() : 0));console.log(`nsig=${allSignatures.length}`);i=0;for(constsigofallSignatures){console.log(`sig[${i++}](OUID ${(Objectasany).__oid(sig)} => ${sig.verified})}\n`);}constnewestSig=allSignatures.find(sig=>sig.verified===true);if(newestSig){returnnewestSig.created ? newestSig.created.getTime() : 0;}thrownewError('No valid signature found in key');}
After calling await key.getExpirationTime(); // will force all sigs to be verified we expect signatures to be verified, however when enumerating signatures, verified is not set.
I could solve it by changing all this[verified] into this.verified.
Additional info:
Extra stuff used here:
// Based on https://stackoverflow.com/a/1997811/1540501// inject oids(function(){if(typeofObject.__oid=="undefined"){varid=0;Object.__oid=function(o){if(typeofo.__uniqueid=="undefined"){Object.defineProperty(o,"__uniqueid",{value: ++id,enumerable: false,// This could go either way, depending on your// interpretation of what an "id" iswritable: false});}returno.__uniqueid;};}})();
The text was updated successfully, but these errors were encountered:
Following code in
async verify(key, signatureType, data, ...
breaks following use case (Typescript, source code origin: https://github.com/FlowCrypt/flowcrypt-ios/, please note: this code is "source available", but not open source):
After calling
await key.getExpirationTime(); // will force all sigs to be verified
we expect signatures to be verified, however when enumerating signatures,verified
is not set.I could solve it by changing all
this[verified]
intothis.verified
.Additional info:
Extra stuff used here:
The text was updated successfully, but these errors were encountered: