Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1/3] Keydata v3 platform API changes #265

Merged
merged 23 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0dc8c1b
keydata.go: introduce MakeDiskUnlockKey() API and new key format
sespiros Oct 18, 2023
f6cba7e
keydata.go: allow marshalling hashAlg to ASN1
sespiros Oct 16, 2023
cfcca36
platform.go: add new API for PlatformKeyData
sespiros Oct 13, 2023
0712e4b
keydata.go: initial changes to passphrase-backed keys
sespiros Oct 16, 2023
7fe9a98
keydata.go: add NewKeyDataWithPassphrase API
sespiros Oct 16, 2023
98db494
keydata.go: remove old API around passphrase protected payloads
sespiros Oct 16, 2023
fdfa79e
keydata*test.go: fix/add tests
sespiros Oct 19, 2023
6452fb6
keydata*test.go: add API tests for keydata v3
sespiros Oct 19, 2023
977d320
crypt_test.go: add API tests for keydata v3
sespiros Oct 20, 2023
5af09ed
keydata*.go: refactored the legacy keyData test suite
sespiros Jan 9, 2024
1a9de9b
keydata*.go: modify version behavior and fix legacy test cases
sespiros Jan 10, 2024
08c2d56
keydata_test.go: make use of helper in tests
sespiros Jan 15, 2024
c8cb933
keydata*test.go: validate mock platform data fields
sespiros Jan 15, 2024
3cf4c26
keydata.go,platform.go: add doc comments
sespiros Jan 15, 2024
759419a
keydata.go: add doc comments
sespiros Jan 22, 2024
ce63a2f
keydata_test.go: add tests for derivePassphraseKeys error handling
sespiros Jan 22, 2024
25099ff
keydata_test.go: test cleanup
sespiros Jan 22, 2024
c7d0f3b
fixup! keydata*test.go: validate mock platform data fields
sespiros Jan 29, 2024
7f9a3b7
fixup! keydata*test.go: validate mock platform data fields
sespiros Jan 29, 2024
8c92177
keydata*test.go: add test case for unavailable KDF
sespiros Feb 7, 2024
18b89e5
keydata.go: add doc comment for KDFAlg field
sespiros Feb 7, 2024
23c36bc
keydata_test.go: add test case for derivation info fields
sespiros Feb 7, 2024
ce88f13
multiple: rename version field to generation
sespiros Feb 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
255 changes: 139 additions & 116 deletions crypt_test.go

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ import (
"github.com/snapcore/secboot/internal/luksview"
)

var (
UnmarshalV1KeyPayload = unmarshalV1KeyPayload
UnmarshalProtectedKeys = unmarshalProtectedKeys
KeyDataVersion = keyDataVersion
)

type ProtectedKeys = protectedKeys

func (o *KDFOptions) DeriveCostParams(keyLen int, kdf KDF) (*KDFCostParams, error) {
return o.deriveCostParams(keyLen, kdf)
}
Expand Down Expand Up @@ -119,3 +127,11 @@ func MockStderr(w io.Writer) (restore func()) {
osStderr = orig
}
}

func MockKeyDataVersion(n int) (restore func()) {
orig := keyDataVersion
keyDataVersion = n
return func() {
keyDataVersion = orig
}
}
Loading
Loading