Add support for i686-linux

This commit is contained in:
Brian Picciano 2023-11-10 12:58:11 +01:00
parent dce01bd31b
commit 023dffe70c
3 changed files with 21 additions and 2 deletions

View File

@ -9,12 +9,14 @@
outputs = { self, nixpkgs, utils, naersk, rust-overlay }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
buildTargetsBySystem = {
"x86_64-linux" = "x86_64-unknown-linux-musl";
"i686-linux" = "i686-unknown-linux-musl";
"aarch64-linux" = "aarch64-unknown-linux-musl";
};
supportedSystems = builtins.attrNames buildTargetsBySystem;
eachCrossSystem = callback: (builtins.foldl'
(overall: buildSystem: overall // {
${buildSystem} = (builtins.foldl'

View File

@ -3,5 +3,6 @@ channel = "nightly-2023-07-23"
components = [ "rustfmt", "rustc-dev", "clippy", "cargo" ]
targets = [
"x86_64-unknown-linux-musl",
"i686-unknown-linux-musl",
"aarch64-unknown-linux-musl"
]

View File

@ -42,7 +42,7 @@ impl Certificate {
.or_unexpected_while("setting not_before")?;
// 9999/07/23
let not_after = Asn1Time::from_unix(253388296800).expect("initializing not_after");
let not_after = Asn1Time::from_str("99990723000000Z").expect("initializing not_after");
builder
.set_not_after(not_after.as_ref())
.or_unexpected_while("setting not_after")?;
@ -157,3 +157,19 @@ impl std::iter::IntoIterator for CertificateChain {
self.0.into_iter()
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::domain;
use crate::domain::tls::PrivateKey;
use std::str::FromStr;
#[test]
fn make_cert() {
let pkey = PrivateKey::new();
let domain = domain::Name::from_str("foo.com").expect("domain name parsed");
let cert = Certificate::new_self_signed(&pkey, &domain).expect("cert created");
println!("{}", cert);
}
}