@@ -224,7 +224,7 @@ private Task<List<PackageSignature>> FindSignaturesAsync(IValidationRequest requ
224224 . PackageSignatures
225225 . Where ( s => s . PackageKey == request . PackageKey )
226226 . Include ( s => s . TrustedTimestamps )
227- . Include ( s => s . Certificate )
227+ . Include ( s => s . EndCertificate )
228228 . ToListAsync ( ) ;
229229 }
230230
@@ -249,13 +249,13 @@ private void PromoteSignatures(IEnumerable<PackageSignature> signatures)
249249 /// <returns>True if the signature should be "Valid", false if it should be "InGracePeriod".</returns>
250250 private bool IsValidSignatureOutOfGracePeriod ( PackageSignature signature )
251251 {
252- var certificate = signature . Certificate ;
252+ var certificate = signature . EndCertificate ;
253253
254254 // A signature can be valid even if its certificate is revoked as long as the certificate
255255 // revocation date begins after the signature was created. The validation pipeline does
256256 // not revalidate revoked certificates, thus, a valid package signature with a revoked
257257 // certificate should be "Valid" regardless of the certificate's status update time.
258- if ( certificate . Status == CertificateStatus . Revoked )
258+ if ( certificate . Status == EndCertificateStatus . Revoked )
259259 {
260260 return true ;
261261 }
@@ -284,14 +284,14 @@ private IEnumerable<PackageSignature> FindSignaturesToInvalidate(IEnumerable<Pac
284284 {
285285 // Revalidation requests do NOT revalidate certificates that are known to be revoked. Thus,
286286 // certificates that were revoked before the package was signed ALWAYS invalidate the signature.
287- if ( s . Certificate . Status == CertificateStatus . Revoked )
287+ if ( s . EndCertificate . Status == EndCertificateStatus . Revoked )
288288 {
289- return s . TrustedTimestamps . Any ( t => s . Certificate . RevocationTime . Value <= t . Value ) ;
289+ return s . TrustedTimestamps . Any ( t => s . EndCertificate . RevocationTime . Value <= t . Value ) ;
290290 }
291291
292292 // Revalidation requests will revalidate invalid certificates. Therefore, invalid certificates
293293 // should invalidate the signature only if this is not a revalidation request.
294- if ( s . Certificate . Status == CertificateStatus . Invalid )
294+ if ( s . EndCertificate . Status == EndCertificateStatus . Invalid )
295295 {
296296 return ! isRevalidationRequest ;
297297 }
@@ -330,14 +330,14 @@ private void InvalidatePackageSignatures(IValidationRequest request, PackageSign
330330 /// <param name="signatures">The signatures used to sign the package requested by the validation request.</param>
331331 /// <param name="isRevalidationRequest">Whether this package has already been validated.</param>
332332 /// <returns>The certificates used to sign the package that should be validated.</returns>
333- private IEnumerable < Certificate > FindCertificatesToValidateAsync ( IEnumerable < PackageSignature > signatures , bool isRevalidationRequest )
333+ private IEnumerable < EndCertificate > FindCertificatesToValidateAsync ( IEnumerable < PackageSignature > signatures , bool isRevalidationRequest )
334334 {
335335 // Get all the certificates used to sign the signatures. Note that revoked certificates
336336 // should NEVER be revalidated as Certificate Authorities may, under certain conditions,
337337 // drop a revoked certificate's revocation information. Revalidating such a revoked
338338 // certificate would cause the certificate to be marked as "Good" when in reality it
339339 // should remain revoked.
340- var certificates = signatures . Select ( s => s . Certificate ) . Where ( c => c . Status != CertificateStatus . Revoked ) ;
340+ var certificates = signatures . Select ( s => s . EndCertificate ) . Where ( c => c . Status != EndCertificateStatus . Revoked ) ;
341341
342342 // Skip certificates that have been validated recently unless this is a revalidation request.
343343 if ( ! isRevalidationRequest )
@@ -353,7 +353,7 @@ private IEnumerable<Certificate> FindCertificatesToValidateAsync(IEnumerable<Pac
353353 /// </summary>
354354 /// <param name="certificate">The certificate that may be revalidated.</param>
355355 /// <returns>Whether the certificate should be revalidated.</returns>
356- private bool ShouldValidateCertificate ( Certificate certificate )
356+ private bool ShouldValidateCertificate ( EndCertificate certificate )
357357 {
358358 // Validate the certificate only if it has never been validated before, or, if
359359 // its last validation time is past the maximum revalidation threshold.
@@ -368,24 +368,24 @@ private bool ShouldValidateCertificate(Certificate certificate)
368368 }
369369
370370 /// <summary>
371- /// Enqueue certificate verifications and add <see cref="CertificateValidation "/> entities
371+ /// Enqueue certificate verifications and add <see cref="EndCertificateValidation "/> entities
372372 /// for each validation. Note that this does NOT save the entity context!
373373 /// </summary>
374374 /// <param name="request">The package validation request.</param>
375375 /// <param name="certificates">The certificates that should be verified.</param>
376376 /// <returns>A task that completes when all certificate verifications have been enqueued.</returns>
377- private Task StartCertificateValidationsAsync ( IValidationRequest request , IEnumerable < Certificate > certificates )
377+ private Task StartCertificateValidationsAsync ( IValidationRequest request , IEnumerable < EndCertificate > certificates )
378378 {
379379 var startCertificateVerificationTasks = new List < Task > ( ) ;
380380
381381 foreach ( var certificate in certificates )
382382 {
383383 startCertificateVerificationTasks . Add ( _certificateVerificationEnqueuer . EnqueueVerificationAsync ( request , certificate ) ) ;
384384
385- _validationContext . CertificateValidations . Add ( new CertificateValidation
385+ _validationContext . CertificateValidations . Add ( new EndCertificateValidation
386386 {
387387 ValidationId = request . ValidationId ,
388- Certificate = certificate ,
388+ EndCertificate = certificate ,
389389 Status = null ,
390390 } ) ;
391391 }
0 commit comments