debug: add SigV4 mismatch logging with expected vs received signature
Deploy FileDrop / deploy (push) Successful in 38s
Deploy FileDrop / deploy (push) Successful in 38s
This commit is contained in:
@@ -331,7 +331,22 @@ export const verifySignature = async (
|
||||
const signingKey = await getSigningKey(s3SecretKey, dateStamp, region);
|
||||
const expectedSignature = await hmacHex(signingKey, stringToSign);
|
||||
|
||||
// TEMP DEBUG: log signature mismatch details
|
||||
if (!timingSafeCompare(expectedSignature, parsed.signature)) {
|
||||
const debugInfo = {
|
||||
method,
|
||||
uri: canonicalUri,
|
||||
canReq: canonicalRequest.slice(0, 400),
|
||||
hashedCR: hashedCanonicalRequest,
|
||||
amzDate,
|
||||
dateStamp,
|
||||
scope: credentialScope,
|
||||
stringToSign: stringToSign.slice(0, 300),
|
||||
expectedSig: expectedSignature,
|
||||
receivedSig: parsed.signature,
|
||||
accessKey: parsed.accessKey,
|
||||
};
|
||||
console.error('SIGV4_MISMATCH:' + JSON.stringify(debugInfo));
|
||||
return { isValid: false, credential: null, errorCode: 'SignatureDoesNotMatch' };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user