Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.
/ ServerCommon Public archive

[Package Signing] Store a package signature's end certificate instead of the full chain #72

Merged
merged 1 commit into from
Oct 13, 2017

Conversation

loic-sharma
Copy link
Contributor

@loic-sharma loic-sharma commented Oct 13, 2017

A single certificate may have multiple valid certificate chains (see the "Certificate chains and cross-certification" section here). Therefore, we should not store the full certificate chain when validating a certificate as this may change. Instead, the certificate's chain should be rebuilt every time the certificate is validated.

I also added the Invalid CertificateStatus. Unlike Revoked, an Invalid status invalidates ALL signatures that depends on this certificate.

These are breaking changes, however, we haven't run the "AddPackageSigninigSchema" migration anywhere.

@dnfclas
Copy link

dnfclas commented Oct 13, 2017

@loic-sharma,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

Copy link
Contributor

@scottbommarito scottbommarito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not an EF expert but this looks good AFAIK

/// The time at which this signature was created. A signature is valid as long as it was signed
/// before its certificates were revoked and/or expired. This timestamp SHOULD come from a trusted
/// before its certificates were revoked and/or expired. This timestamp MUST come from a trusted
/// timestamp authority.
/// </summary>
public DateTime SignedAt { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using DateTimeOffset instead wherever you use DateTime.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked to Damon offline. Using DateTimeOffset properties changes the SQL Server column type from datetime2 to datetimeoffset. This datetimeoffset type stores both the UTC timestamp and the client's offset from the UTC timestamp. Considering that all other entities use DateTime, we decided it would be better to stick to DateTime and then enforce that all code uses UTC timestamp.

@loic-sharma loic-sharma merged commit e7ef8ee into dev Oct 13, 2017
@xavierdecoster xavierdecoster deleted the loshar-update branch October 17, 2017 17:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants