[control] QC minors: device install links open a page and download on POST (never listed), approve and install failures show on the request and the CLI waits, PBKDF2 floor, private pki dirs or an error, trusted_proxies for a proxy in front, a placeholder keeps the device allow list from being empty (Caddy refuses that)
This commit is contained in:
@@ -193,6 +193,27 @@ pub fn create_root(now: i64) -> Result<(String, KeyPair), PkiError> {
|
||||
Ok((cert.pem(), key))
|
||||
}
|
||||
|
||||
/// Common name of [`no_device_placeholder`].
|
||||
pub const NO_DEVICE_CN: &str = "Ianitor placeholder: no device is allowed";
|
||||
|
||||
/// The allow list's only entry while no device is enrolled. Caddy refuses to load an empty
|
||||
/// leaf list (and with it the whole config), so the list is never empty: this self-signed
|
||||
/// certificate's key is dropped right here, so no client can ever present it, and it is not
|
||||
/// issued by the Domi intermediate, so edge refuses it too.
|
||||
pub fn no_device_placeholder(now: i64) -> Result<String, PkiError> {
|
||||
let key = generate_key()?;
|
||||
let mut p = CertificateParams::default();
|
||||
p.distinguished_name = dn(NO_DEVICE_CN);
|
||||
p.is_ca = IsCa::ExplicitNoCa;
|
||||
p.key_usages = vec![KeyUsagePurpose::DigitalSignature];
|
||||
p.not_before = time(now - BACKDATE_SECS)?;
|
||||
p.not_after = time(now + 100 * 365 * DAY)?;
|
||||
p.serial_number = Some(serial()?);
|
||||
let cert = p.self_signed(&key.0).map_err(build)?;
|
||||
drop(key);
|
||||
Ok(cert.pem())
|
||||
}
|
||||
|
||||
/// A CSR for a new intermediate key (made by control on the server).
|
||||
pub fn intermediate_csr(key: &KeyPair, cn: &str) -> Result<String, PkiError> {
|
||||
let mut p = CertificateParams::default();
|
||||
|
||||
Reference in New Issue
Block a user