This commit is contained in:
Bryan Ashby 2023-03-06 17:19:20 -07:00
parent b0fff20a02
commit 6afbb29139
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
1 changed files with 14 additions and 6 deletions

View File

@ -511,7 +511,7 @@ exports.getModule = class ActivityPubWebHandler extends WebHandlerModule {
} }
if ( if (
!this._isSignatureEqual( !this._isSignatureValid(
activity.signature, activity.signature,
objInfo.object.signature objInfo.object.signature
) )
@ -527,7 +527,13 @@ exports.getModule = class ActivityPubWebHandler extends WebHandlerModule {
collectionName, collectionName,
objInfo.object, objInfo.object,
stats, stats,
nextObjInfo () => {
if ('Note' === objInfo.object.type) {
// :TODO: delete associated message!
}
return nextObjInfo(null);
}
); );
case Collections.Actors: case Collections.Actors:
@ -584,11 +590,13 @@ exports.getModule = class ActivityPubWebHandler extends WebHandlerModule {
}); });
} }
_isSignatureEqual(sigA, sigB) { _isSignatureValid(request, object) {
// :TODO: We need to validate signatures here -- this is no good
// https://github.com/transmute-industries/RsaSignature2017
return ( return (
sigA.type === sigB.type && request.type === object.type && request.creator === object.creator
sigA.creator === sigB.creator && //&&
sigA.signatureValue === sigB.signatureValue // request.signatureValue === object.signatureValue
); );
} }