-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds the types for the new key attestation operations and their conversions to/from protobuf. Signed-off-by: Ionut Mihalcea <[email protected]>
- Loading branch information
Showing
11 changed files
with
1,052 additions
and
15 deletions.
There are no files selected for viewing
Submodule parsec-operations
updated
7 files
+2 −0 | .github/CODEOWNERS | |
+8 −0 | .github/workflows/ci.yml | |
+21 −0 | buf.yaml | |
+22 −0 | ci/check_breaking_changes.sh | |
+30 −0 | protobuf/attest_key.proto | |
+24 −0 | protobuf/can_do_crypto.proto | |
+30 −0 | protobuf/prepare_key_attestation.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2021 Contributors to the Parsec project. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
//! # AttestKey operation | ||
//! | ||
//! Produce an attestation token as proof that the given | ||
//! key was produced and is stored in the hardware backend. | ||
use derivative::Derivative; | ||
use zeroize::Zeroizing; | ||
|
||
/// Native operation for key attestation | ||
#[derive(Derivative)] | ||
#[derivative(Debug)] | ||
#[non_exhaustive] | ||
pub enum Operation { | ||
/// Attestation via TPM 2.0 ActivateCredential operation | ||
ActivateCredential { | ||
/// Name of key to be attested | ||
attested_key_name: String, | ||
/// Blob of data representing the encrypted credential | ||
#[derivative(Debug = "ignore")] | ||
credential_blob: Zeroizing<Vec<u8>>, | ||
/// Blob of data representing the encrypted secret | ||
#[derivative(Debug = "ignore")] | ||
secret: Zeroizing<Vec<u8>>, | ||
/// Name of key to be used for attesting | ||
attesting_key_name: Option<String>, | ||
}, | ||
} | ||
|
||
/// Native result of key attestation | ||
#[derive(Derivative)] | ||
#[derivative(Debug)] | ||
#[non_exhaustive] | ||
pub enum Result { | ||
/// Result of attestation via TPM 2.0 ActivateCredential operation | ||
ActivateCredential { | ||
/// Decrypted credential | ||
#[derivative(Debug = "ignore")] | ||
credential: Zeroizing<Vec<u8>>, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2021 Contributors to the Parsec project. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
//! # PrepareKeyAttestation operation | ||
//! | ||
//! Produce any parameters required for the AttestKey operation | ||
use derivative::Derivative; | ||
use zeroize::Zeroizing; | ||
|
||
/// Native operation for retrieving key attestation parameters | ||
#[derive(Debug)] | ||
#[non_exhaustive] | ||
pub enum Operation { | ||
/// Get parameters for TPM 2.0 ActivateCredential operation | ||
ActivateCredential { | ||
/// Name of key to be attested | ||
attested_key_name: String, | ||
/// Name of key to be used for attesting | ||
attesting_key_name: Option<String>, | ||
}, | ||
} | ||
|
||
/// Native result of retrieving key attestation parameters | ||
#[derive(Derivative)] | ||
#[derivative(Debug)] | ||
#[non_exhaustive] | ||
pub enum Result { | ||
/// Parameters for TPM 2.0 ActivateCredential operation | ||
ActivateCredential { | ||
/// TPM name of key to be attested | ||
#[derivative(Debug = "ignore")] | ||
name: Zeroizing<Vec<u8>>, | ||
/// TPM public key parameters of object to be attested | ||
#[derivative(Debug = "ignore")] | ||
public: Zeroizing<Vec<u8>>, | ||
/// Public part of attesting key | ||
#[derivative(Debug = "ignore")] | ||
attesting_key_pub: Zeroizing<Vec<u8>>, | ||
}, | ||
} |
Oops, something went wrong.