Skip to content

Commit db08b1b

Browse files
committed
Centralize ACME bootstrap state filename
1 parent 0d486bc commit db08b1b

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

crates/fluxheim-acme/src/acme_account_bootstrap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use super::*;
2+
use crate::acme_account_state::ACCOUNT_BOOTSTRAP_PENDING_FILE;
23
use rustls::pki_types::{PrivateKeyDer, PrivatePkcs8KeyDer};
34
use sanitization::SecretVec;
45
use sanitization::ct::ConstantTimeEq as _;
56
use sha2::{Digest as _, Sha256};
67

7-
const ACCOUNT_BOOTSTRAP_PENDING_FILE: &str = ".credentials.bootstrap.pending";
88
const ACCOUNT_BOOTSTRAP_MAGIC: &[u8] = b"FLUXHEIM-ACME-ACCOUNT-KEY-V1\0";
99
const ACCOUNT_BOOTSTRAP_ISSUER_HASH_BYTES: usize = 32;
1010
const MAX_ACCOUNT_BOOTSTRAP_BYTES: u64 = 4096;

crates/fluxheim-acme/src/acme_tests_account_bootstrap.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use super::*;
2+
use crate::acme_account_state::ACCOUNT_BOOTSTRAP_PENDING_FILE;
23

34
fn bootstrap_credentials(
45
bootstrap: &mut PendingAccountBootstrap,
@@ -209,7 +210,7 @@ fn account_bootstrap_promotion_is_durable_and_cleans_pending_key() {
209210
.path
210211
.parent()
211212
.unwrap()
212-
.join(".credentials.bootstrap.pending");
213+
.join(ACCOUNT_BOOTSTRAP_PENDING_FILE);
213214
assert!(!pending_path.exists());
214215
}
215216

@@ -228,7 +229,7 @@ fn account_bootstrap_sanitizes_pending_key_before_unlink() {
228229
.path
229230
.parent()
230231
.unwrap()
231-
.join(".credentials.bootstrap.pending");
232+
.join(ACCOUNT_BOOTSTRAP_PENDING_FILE);
232233
let retained_link = storage.join("pending-key-sanitization-witness");
233234
std::fs::hard_link(&pending_path, &retained_link).unwrap();
234235

@@ -260,7 +261,7 @@ fn account_bootstrap_recovers_after_credentials_publish_before_cleanup() {
260261
.path
261262
.parent()
262263
.unwrap()
263-
.join(".credentials.bootstrap.pending");
264+
.join(ACCOUNT_BOOTSTRAP_PENDING_FILE);
264265
assert!(!pending_path.exists());
265266
}
266267

@@ -326,7 +327,7 @@ fn pending_account_bootstrap_key_is_owner_only() {
326327
.path
327328
.parent()
328329
.unwrap()
329-
.join(".credentials.bootstrap.pending");
330+
.join(ACCOUNT_BOOTSTRAP_PENDING_FILE);
330331
assert_eq!(
331332
std::fs::metadata(pending_path)
332333
.unwrap()
@@ -354,7 +355,7 @@ fn account_bootstrap_rejects_symlinked_pending_key() {
354355
.path
355356
.parent()
356357
.unwrap()
357-
.join(".credentials.bootstrap.pending");
358+
.join(ACCOUNT_BOOTSTRAP_PENDING_FILE);
358359
std::fs::remove_file(&pending_path).unwrap();
359360
let outside = storage.with_extension("outside-key");
360361
std::fs::write(&outside, b"outside").unwrap();

0 commit comments

Comments
 (0)