Commit 5cc5b025 authored by Ian Jackson's avatar Ian Jackson
Browse files

tor-netdoc: votes: use EmbeddedCert for the authhcert

parent 24cd244d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1357,7 +1357,7 @@ pub struct VoteAuthoritySection {

    /// Authority key certificate
    #[deftly(constructor)]
    pub cert: EncodedAuthCert,
    pub cert: EmbeddedCert<AuthCert, EncodedAuthCert>,

    #[doc(hidden)]
    #[deftly(netdoc(skip))]
+5 −1
Original line number Diff line number Diff line
@@ -160,9 +160,11 @@ ns_choose! { (

    impl NetworkStatus {
        /// Parse the embedded authcert
        //
        // TODO DIRAUTH abolish/move
        fn parse_authcert(&self) -> Result<crate::doc::authcert::AuthCertUnverified, EP> {
            let cert_input = ParseInput::new(
                self.authority.cert.as_str(),
                self.authority.cert.raw_unverified().as_str(),
                "<embedded auth cert>",
            );
            parse_netdoc(&cert_input).map_err(|e| e.problem)
@@ -177,6 +179,8 @@ ns_choose! { (
        ///
        /// It is up to the caller to decide whether this identity is actually
        /// a voter, count up votes, etc.
        //
        // TODO DIRAUTH use EmbeddedCert::get
        pub fn h_kp_auth_id_rsa(&self) -> pk::rsa::RsaIdentity {
            *self.parse_authcert()
                // SECURITY: if the user calls this function, they have a bare