Skip to content

Commit d7b8f27

Browse files
committed
Rename get_eth_key to get_key
1 parent c6784b7 commit d7b8f27

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

guest-agent/rpc/proto/agent_rpc.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ service Tappd {
1111
rpc DeriveKey(GetTlsKeyArgs) returns (GetTlsKeyResponse) {}
1212

1313
// Derives a new ECDSA key with k256 EC curve.
14-
rpc DeriveK256Key(GetEthKeyArgs) returns (DeriveK256KeyResponse) {}
14+
rpc DeriveK256Key(GetKeyArgs) returns (DeriveK256KeyResponse) {}
1515

1616
// Generates a TDX quote
1717
rpc TdxQuote(TdxQuoteArgs) returns (TdxQuoteResponse) {}
@@ -34,7 +34,7 @@ service DstackGuest {
3434
rpc GetTlsKey(GetTlsKeyArgs) returns (GetTlsKeyResponse) {}
3535

3636
// Derives a new ECDSA key with k256 EC curve.
37-
rpc GetEthKey(GetEthKeyArgs) returns (GetEthKeyResponse) {}
37+
rpc GetKey(GetKeyArgs) returns (GetKeyResponse) {}
3838

3939
// Generates a TDX quote with given report data.
4040
rpc GetQuote(RawQuoteArgs) returns (GetQuoteResponse) {}
@@ -72,7 +72,7 @@ message GetTlsKeyResponse {
7272
}
7373

7474
// The request to derive a new ECDSA key with k256 EC curve
75-
message GetEthKeyArgs {
75+
message GetKeyArgs {
7676
// Path to the key to derive
7777
string path = 1;
7878
// Purpose of the key
@@ -88,7 +88,7 @@ message DeriveK256KeyResponse {
8888
}
8989

9090
// The response to a GetEthKey request
91-
message GetEthKeyResponse {
91+
message GetKeyResponse {
9292
// Derived k256 key
9393
bytes key = 1;
9494
// Derived k256 signature chain

guest-agent/src/rpc_service.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use dstack_guest_agent_rpc::{
66
dstack_guest_server::{DstackGuestRpc, DstackGuestServer},
77
tappd_server::{TappdRpc, TappdServer},
88
worker_server::{WorkerRpc, WorkerServer},
9-
DeriveK256KeyResponse, GetEthKeyArgs, GetEthKeyResponse, GetQuoteResponse, GetTlsKeyArgs,
9+
DeriveK256KeyResponse, GetKeyArgs, GetKeyResponse, GetQuoteResponse, GetTlsKeyArgs,
1010
GetTlsKeyResponse, RawQuoteArgs, TdxQuoteArgs, TdxQuoteResponse, WorkerInfo, WorkerVersion,
1111
};
1212
use dstack_types::AppKeys;
@@ -114,7 +114,7 @@ impl DstackGuestRpc for InternalRpcHandler {
114114
})
115115
}
116116

117-
async fn get_eth_key(self, request: GetEthKeyArgs) -> Result<GetEthKeyResponse> {
117+
async fn get_key(self, request: GetKeyArgs) -> Result<GetKeyResponse> {
118118
let k256_app_key = &self.state.inner.keys.k256_key;
119119
let derived_k256_key = derive_ecdsa_key(k256_app_key, &[request.path.as_bytes()], 32)
120120
.context("Failed to derive k256 key")?;
@@ -131,7 +131,7 @@ impl DstackGuestRpc for InternalRpcHandler {
131131
let mut signature = signature.to_vec();
132132
signature.push(recid.to_byte());
133133

134-
Ok(GetEthKeyResponse {
134+
Ok(GetKeyResponse {
135135
key: derived_k256_key.to_bytes().to_vec(),
136136
signature_chain: vec![signature, self.state.inner.keys.k256_signature.clone()],
137137
})
@@ -185,9 +185,9 @@ impl TappdRpc for InternalRpcHandlerV0 {
185185
.await
186186
}
187187

188-
async fn derive_k256_key(self, request: GetEthKeyArgs) -> Result<DeriveK256KeyResponse> {
188+
async fn derive_k256_key(self, request: GetKeyArgs) -> Result<DeriveK256KeyResponse> {
189189
let res = InternalRpcHandler { state: self.state }
190-
.get_eth_key(request)
190+
.get_key(request)
191191
.await?;
192192
Ok(DeriveK256KeyResponse {
193193
k256_key: res.key,

0 commit comments

Comments
 (0)