return SignatureStatus.STATUS_FAILED;
}
}
private SignatureStatus verifySignatureForTrustedAuthority(DirectoryServer trustedAuthority, DirectorySignature signature) {
final KeyCertificate certificate = trustedAuthority.getCertificateByFingerprint(signature.getSigningKeyDigest());
if(certificate == null) {
logger.fine("Missing certificate for signing key: "+ signature.getSigningKeyDigest());
addRequiredCertificateForSignature(signature);
return SignatureStatus.STATUS_NEED_CERTS;
}
if(certificate.isExpired()) {
return SignatureStatus.STATUS_FAILED;
}
final TorPublicKey signingKey = certificate.getAuthoritySigningKey();
final HexDigest d = (signature.useSha256()) ? signingHash256 : signingHash;
if(!signingKey.verifySignature(signature.getSignature(), d)) {
logger.warning("Signature failed on consensus for signing key: "+ signature.getSigningKeyDigest());
return SignatureStatus.STATUS_FAILED;
}