Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit 6c62790

Browse files
committed
Add the package validation state before adding the signature records (#349)
Fix NuGet/Engineering#1186
1 parent 11c84fc commit 6c62790

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/Validation.PackageSigning.ExtractAndValidateSignature/SignatureValidator.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,13 @@ private async Task<SignatureValidatorResult> HandleSignedPackageAsync(
202202
new ClientSigningVerificationFailure(ex.Code.ToString(), ex.Message));
203203
}
204204

205+
// Mark this package as signed. This needs to happen before the extraction due to a foreign key constraint.
206+
var result = await AcceptAsync(packageKey, message, PackageSigningStatus.Valid);
207+
205208
// Extract all of the signature artifacts and persist them.
206209
await _signaturePartsExtractor.ExtractAsync(packageKey, signedPackageReader, cancellationToken);
207210

208-
// Mark this package as signed.
209-
return await AcceptAsync(packageKey, message, PackageSigningStatus.Valid);
211+
return result;
210212
}
211213

212214
private async Task<SignatureValidatorResult> GetVerifyResult(

0 commit comments

Comments
 (0)