Skip to content

Ignore b1/b3 buf.lock digests only#2111

Merged
pkwarren merged 3 commits intomainfrom
pkw/issue-2110
May 23, 2023
Merged

Ignore b1/b3 buf.lock digests only#2111
pkwarren merged 3 commits intomainfrom
pkw/issue-2110

Conversation

@pkwarren
Copy link
Member

Update the code that reads a buf.lock file from disk to only ignore previous b1/b3 module digests. If the lock file has an invalid manifest digest, we want to error early.

Fixes #2110.

Update the code that reads a buf.lock file from disk to only ignore
previous b1/b3 module digests. If the lock file has an invalid manifest
digest, we want to error early.

// isValidDigest returns true when the digest string is successfully parsed
// by the `manifest` pkg. Older buf digests are not considered valid (b1/b3).
func isValidDigest(digest string) bool {
Copy link
Member Author

@pkwarren pkwarren May 22, 2023

Choose a reason for hiding this comment

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

This was too lenient before - it would also ignore a digest field in the newer format that wasn't valid (wrong encoding, length, algorithm, etc.). We only wanted to ignore buf.lock digest values which may have potentially contained a b1/b3 digest value.

@pkwarren pkwarren changed the title Ignore b1/b3 digests Ignore b1/b3 buf.lock digests only May 22, 2023
@pkwarren pkwarren merged commit f509df4 into main May 23, 2023
@pkwarren pkwarren deleted the pkw/issue-2110 branch May 23, 2023 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Silent success with invalid digest

3 participants