@@ -226,6 +226,7 @@ impl<S: CertificationScheme> CertifiedKeygen<S> {
226226 . certificate
227227 . get ( & cert_key)
228228 . ok_or ( "I haven't certified this keygen" ) ?;
229+ // We may have gotten this certificate from *somewhere* so must verify we certified it
229230 if cert_scheme
230231 . verify_cert ( cert_key, & self . input , my_cert)
231232 . is_none ( )
@@ -337,7 +338,7 @@ impl SecretShareReceiver {
337338 cert_scheme : & S ,
338339 certificate : Certificate < S :: Signature > ,
339340 contributor_keys : & [ Point ] ,
340- ) -> Result < ( CertifiedKeygen < S > , PairedSecretShare < Normal , Zero > ) , & ' static str > {
341+ ) -> Result < ( CertifiedKeygen < S > , PairedSecretShare < Normal , Zero > ) , CertificateError > {
341342 let mut outputs = BTreeMap :: new ( ) ;
342343 let cert_keys = self
343344 . agg_input
@@ -350,9 +351,9 @@ impl SecretShareReceiver {
350351 Some ( output) => {
351352 outputs. insert ( cert_key, output) ;
352353 }
353- None => return Err ( "certification signature was invalid" ) ,
354+ None => return Err ( CertificateError :: InvalidCert { key : cert_key } ) ,
354355 } ,
355- None => return Err ( "missing certification signature" ) ,
356+ None => return Err ( CertificateError :: Missing { key : cert_key } ) ,
356357 }
357358 }
358359
0 commit comments