tor-netdoc: Use a more correct error type

If we fail to convert a curve25519 key to an ed25519 key for checking
the onion-key crosscert, don't call that an internal error: it means
that something is wrong with the provided ntor key.
This commit is contained in:
Nick Mathewson 2021-12-20 08:58:30 -05:00
parent 92e53bff62
commit 6299ca70b4
1 changed files with 1 additions and 1 deletions

View File

@ -505,7 +505,7 @@ impl RouterDesc {
}
let ntor_as_ed =
ll::pk::keymanip::convert_curve25519_to_ed25519_public(&ntor_onion_key, sign)
.ok_or_else(|| Error::Internal(cc.pos()))?; // XXX not really 'internal'
.ok_or_else(|| Error::BadArgument(cc.pos(), "Uncheckable crosscert".into()))?;
cc.parse_obj::<UnvalidatedEdCert>("ED25519 CERT")?
.check_cert_type(tor_cert::CertType::NTOR_CC_IDENTITY)?