mirror of
https://github.com/NLnetLabs/krill.git
synced 2026-09-20 16:37:43 +02:00
Use latest time encoding. #3
This commit is contained in:
@@ -357,7 +357,7 @@ impl SignedAttributes {
|
||||
// attribute using the time that the SignedAttributes
|
||||
// was created.
|
||||
oid::SIGNING_TIME.encode(),
|
||||
encode::set(self.signing_time.encode()),
|
||||
encode::set(self.signing_time.encode_varied()),
|
||||
)),
|
||||
encode::sequence((
|
||||
oid::MESSAGE_DIGEST.encode(),
|
||||
@@ -492,8 +492,8 @@ impl SigMsgCrlBuilder {
|
||||
name.encode_ref(),
|
||||
),
|
||||
(
|
||||
just_now.encode(),
|
||||
in_a_bit.encode(),
|
||||
just_now.encode_varied(),
|
||||
in_a_bit.encode_varied(),
|
||||
// Real revocations go here
|
||||
extensions,
|
||||
),
|
||||
|
||||
@@ -342,7 +342,7 @@ impl IdCert {
|
||||
// Validity. Check according to RFC 5280.
|
||||
self.validity.validate_at(now)?;
|
||||
|
||||
// Subject Key Identifer. Must be the SHA-1 hash of the octets
|
||||
// Subject Key Identifier. Must be the SHA-1 hash of the octets
|
||||
// of the subjectPublicKey.
|
||||
if self.extensions.subject_key_id().as_slice().unwrap()
|
||||
!= self.subject_public_key_info().key_identifier().as_ref()
|
||||
@@ -574,7 +574,7 @@ pub mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_parse_id_publisher_ta_cert() {
|
||||
fn parse_id_publisher_ta_cert() {
|
||||
test_id_certificate()
|
||||
.validate_ta_at(Time::utc(2012, 1, 1, 0, 0, 0))
|
||||
.unwrap();
|
||||
|
||||
@@ -1378,3 +1378,21 @@ impl<S: Signer> CertAuth<S> {
|
||||
Ok(res)
|
||||
}
|
||||
}
|
||||
|
||||
//------------ Tests ---------------------------------------------------------
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::commons::util::softsigner::OpenSslSigner;
|
||||
use crate::commons::util::test;
|
||||
|
||||
#[test]
|
||||
fn generate_id_cert() {
|
||||
test::test_under_tmp(|d| {
|
||||
let mut signer = OpenSslSigner::build(&d).unwrap();
|
||||
let id = Rfc8183Id::generate(&mut signer).unwrap();
|
||||
id.cert.validate_ta().unwrap();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user