22// License, v. 2.0. If a copy of the MPL was not distributed with this
33// file, You can obtain one at https://mozilla.org/MPL/2.0/.
44
5- use log:: { debug, warn} ;
5+ use log:: { debug, trace , warn} ;
66
77use crate :: errors:: {
88 ERR_MSG_ACTOR_CANNOT_BE_CA , ERR_MSG_DC_MISMATCH_ISSUER_SUBJECT ,
@@ -13,12 +13,14 @@ use super::*;
1313
1414impl < S : Signature , P : PublicKey < S > > Constrained for IdCsrInner < S , P > {
1515 fn validate ( & self , target : Option < Target > ) -> Result < ( ) , ConstraintError > {
16- log:: trace!(
16+ #[ cfg( not( tarpaulin_include) ) ]
17+ trace ! (
1718 "[IdCsrInner::validate()] validating capabilities for target: {:?}" ,
1819 target
1920 ) ;
2021 self . capabilities . validate ( target) ?;
21- log:: trace!(
22+ #[ cfg( not( tarpaulin_include) ) ]
23+ trace ! (
2224 "[IdCsrInner::validate()] validating subject for target: {:?}" ,
2325 target
2426 ) ;
@@ -47,12 +49,13 @@ impl<S: Signature, P: PublicKey<S>> Constrained for IdCsrInner<S, P> {
4749
4850impl < S : Signature , P : PublicKey < S > > Constrained for IdCsr < S , P > {
4951 fn validate ( & self , target : Option < Target > ) -> Result < ( ) , ConstraintError > {
50- log :: trace!(
52+ trace ! (
5153 "[IdCsr::validate()] validating inner CSR with target {:?}" ,
5254 target
5355 ) ;
5456 self . inner_csr . validate ( target) ?;
55- log:: trace!( "[IdCsr::validate()] verifying signature" ) ;
57+ #[ cfg( not( tarpaulin_include) ) ]
58+ trace ! ( "[IdCsr::validate()] verifying signature" ) ;
5659 match self . inner_csr . subject_public_key . verify_signature (
5760 & self . signature ,
5861 match & self . inner_csr . clone ( ) . to_der ( ) {
@@ -74,7 +77,8 @@ impl<S: Signature, P: PublicKey<S>> Constrained for IdCsr<S, P> {
7477
7578impl < S : Signature , P : PublicKey < S > > Constrained for IdCert < S , P > {
7679 fn validate ( & self , target : Option < Target > ) -> Result < ( ) , ConstraintError > {
77- log:: trace!(
80+ #[ cfg( not( tarpaulin_include) ) ]
81+ trace ! (
7882 "[IdCert::validate()] validating inner IdCertTbs with target {:?}" ,
7983 target
8084 ) ;
@@ -85,7 +89,8 @@ impl<S: Signature, P: PublicKey<S>> Constrained for IdCert<S, P> {
8589
8690impl < S : Signature , P : PublicKey < S > > Constrained for IdCertTbs < S , P > {
8791 fn validate ( & self , target : Option < Target > ) -> Result < ( ) , ConstraintError > {
88- log:: trace!(
92+ #[ cfg( not( tarpaulin_include) ) ]
93+ trace ! (
8994 "[IdCertTbs::validate()] validating if DER encoding is intact for certificate serial {:?}" ,
9095 self . serial_number
9196 ) ;
@@ -101,25 +106,30 @@ impl<S: Signature, P: PublicKey<S>> Constrained for IdCertTbs<S, P> {
101106 ) ) ) ;
102107 }
103108 } ;
104- log:: trace!(
109+ #[ cfg( not( tarpaulin_include) ) ]
110+ trace ! (
105111 "[IdCertTbs::validate()] validating capabilities for target: {:?}" ,
106112 target
107113 ) ;
108114 self . capabilities . validate ( target) ?;
109115 dbg ! ( self . issuer. to_string( ) ) ;
110116 self . issuer . validate ( Some ( Target :: HomeServer ) ) ?;
111117 self . subject . validate ( target) ?;
112- log:: trace!(
113- "[IdCertTbs::validate()] checking if domain components of issuer and subject are equal"
114- ) ;
115- log:: trace!(
116- "[IdCertTbs::validate()] Issuer: {}" ,
117- self . issuer. to_string( )
118- ) ;
119- log:: trace!(
120- "[IdCertTbs::validate()] Subject: {}" ,
121- self . subject. to_string( )
122- ) ;
118+ #[ cfg( not( tarpaulin_include) ) ]
119+ {
120+ trace ! (
121+ "[IdCertTbs::validate()] checking if domain components of issuer and subject are equal"
122+ ) ;
123+ trace ! (
124+ "[IdCertTbs::validate()] Issuer: {}" ,
125+ self . issuer. to_string( )
126+ ) ;
127+ trace ! (
128+ "[IdCertTbs::validate()] Subject: {}" ,
129+ self . subject. to_string( )
130+ ) ;
131+ }
132+
123133 match equal_domain_components ( & self . issuer , & self . subject ) {
124134 true => debug ! ( "Domain components of issuer and subject are equal" ) ,
125135 false => {
0 commit comments