Skip to content

Commit 3bcfa5e

Browse files
committed
mtc_worker: Remove extra cosigner
Currently mtc_worker loads two cosigners whenever it mints a checkpoint: one for the MTCA itself; and another for a mocked witness. However the mocked witness isn't a proper MTC cosigner, as it doesn't format the message to be signed properly. To avoid confusing users, just remove the witness altogether.
1 parent 38b79c9 commit 3bcfa5e

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

crates/ct_worker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Run the following for each of the `dev2025h1a` and `dev2025h2a` log shards to co
132132
openssl genpkey -algorithm ed25519 | npx wrangler -e=${ENV} secret put WITNESS_KEY_${LOG_NAME}
133133
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 | npx wrangler -e=${ENV} secret put SIGNING_KEY_${LOG_NAME}
134134
135-
(Note: For mtc_worker we use ed25519 for both the witness key and the signing key.)
135+
(Note: For mtc_worker we use ed25519 for the signing key. There is no witness.)
136136
137137
1. Deploy the worker. The worker will be available at `https://static-ct-${ENV}.<your-team>.workers.dev/logs/${LOG_NAME}`.
138138

crates/mtc_worker/src/frontend_worker.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
//! Entrypoint for the static CT submission APIs.
55
66
use crate::{
7-
load_checkpoint_signers, load_origin, load_roots, load_signing_key, load_witness_key,
8-
SequenceMetadata, CONFIG,
7+
load_checkpoint_signers, load_origin, load_roots, load_signing_key, SequenceMetadata, CONFIG,
98
};
109
use der::{
1110
asn1::{SetOfVec, UtcTime, Utf8StringRef},
@@ -50,8 +49,6 @@ struct MetadataResponse<'a> {
5049
description: &'a Option<String>,
5150
#[serde_as(as = "Base64")]
5251
key: &'a [u8],
53-
#[serde_as(as = "Base64")]
54-
witness_key: &'a [u8],
5552
submission_url: &'a str,
5653
monitoring_url: &'a str,
5754
}
@@ -229,15 +226,9 @@ async fn main(req: Request, env: Env, _ctx: Context) -> Result<Response> {
229226
let key = verifying_key
230227
.to_public_key_der()
231228
.map_err(|e| e.to_string())?;
232-
let witness_key = load_witness_key(&ctx.env, name)?;
233-
let witness_key = witness_key
234-
.verifying_key()
235-
.to_public_key_der()
236-
.map_err(|e| e.to_string())?;
237229
Response::from_json(&MetadataResponse {
238230
description: &params.description,
239231
key: key.as_bytes(),
240-
witness_key: witness_key.as_bytes(),
241232
submission_url: &params.submission_url,
242233
monitoring_url: if params.monitoring_url.is_empty() {
243234
&params.submission_url

crates/mtc_worker/src/lib.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use signed_note::KeyName;
1212
use std::collections::HashMap;
1313
use std::str::FromStr;
1414
use std::sync::{LazyLock, OnceLock};
15-
use tlog_tiles::{CheckpointSigner, CosignatureV1CheckpointSigner, SequenceMetadata};
15+
use tlog_tiles::{CheckpointSigner, SequenceMetadata};
1616
use tokio::sync::OnceCell;
1717
#[allow(clippy::wildcard_imports)]
1818
use worker::*;
@@ -31,17 +31,12 @@ static CONFIG: LazyLock<AppConfig> = LazyLock::new(|| {
3131
});
3232

3333
static SIGNING_KEY_MAP: OnceLock<HashMap<String, OnceLock<Ed25519SigningKey>>> = OnceLock::new();
34-
static WITNESS_KEY_MAP: OnceLock<HashMap<String, OnceLock<Ed25519SigningKey>>> = OnceLock::new();
3534
static ROOTS: OnceCell<CertPool> = OnceCell::const_new();
3635

3736
pub(crate) fn load_signing_key(env: &Env, name: &str) -> Result<&'static Ed25519SigningKey> {
3837
load_ed25519_key(env, name, &SIGNING_KEY_MAP, &format!("SIGNING_KEY_{name}"))
3938
}
4039

41-
pub(crate) fn load_witness_key(env: &Env, name: &str) -> Result<&'static Ed25519SigningKey> {
42-
load_ed25519_key(env, name, &WITNESS_KEY_MAP, &format!("WITNESS_KEY_{name}"))
43-
}
44-
4540
pub(crate) fn load_ed25519_key(
4641
env: &Env,
4742
name: &str,
@@ -76,13 +71,11 @@ pub(crate) fn load_checkpoint_signers(env: &Env, name: &str) -> Vec<Box<dyn Chec
7671
// TODO should the CA cosigner have a different ID than the log itself?
7772
let cosigner_id = log_id.clone();
7873
let signing_key = load_signing_key(env, name).unwrap().clone();
79-
let witness_key = load_witness_key(env, name).unwrap().clone();
8074

8175
// Make the checkpoint signers from the secret keys and put them in a vec
8276
let signer = MTCSubtreeCosigner::new(cosigner_id, log_id, origin.clone(), signing_key);
83-
let witness = CosignatureV1CheckpointSigner::new(origin, witness_key);
8477

85-
vec![Box::new(signer), Box::new(witness)]
78+
vec![Box::new(signer)]
8679
}
8780

8881
pub(crate) fn load_origin(name: &str) -> KeyName {

0 commit comments

Comments
 (0)