Commit 3800c459 authored by Nick Mathewson's avatar Nick Mathewson 👁
Browse files

Rename Rsa{Identity,Signature} to fix clippy warning.

parent 401d7e9f
......@@ -219,20 +219,20 @@ mod curve25519_impls {
}
}
/// Implement readable and writeable for the the RSAIdentity type.
/// Implement readable and writeable for the the RsaIdentity type.
mod rsa_impls {
use super::*;
use tor_llcrypto::pk::rsa::*;
impl Writeable for RSAIdentity {
impl Writeable for RsaIdentity {
fn write_onto<B: Writer + ?Sized>(&self, b: &mut B) {
b.write_all(self.as_bytes())
}
}
impl Readable for RSAIdentity {
impl Readable for RsaIdentity {
fn take_from(b: &mut Reader<'_>) -> Result<Self> {
let m = b.take(RSA_ID_LEN)?;
Ok(RSAIdentity::from_bytes(m).expect("take gave wrong length"))
Ok(RsaIdentity::from_bytes(m).expect("take gave wrong length"))
}
}
}
......@@ -410,8 +410,8 @@ mod tests {
#[test]
fn rsa_id() {
use tor_llcrypto::pk::rsa::RSAIdentity;
use tor_llcrypto::pk::rsa::RsaIdentity;
let b = &hex!("9432D4CEA2621ED09F5A8088BE0E31E0D271435C");
check_roundtrip!(RSAIdentity, RSAIdentity::from_bytes(b).unwrap(), b);
check_roundtrip!(RsaIdentity, RsaIdentity::from_bytes(b).unwrap(), b);
}
}
......@@ -11,7 +11,7 @@ use std::net::{IpAddr, Ipv4Addr};
use tor_bytes::{Error, Result};
use tor_bytes::{Readable, Reader, Writeable, Writer};
use tor_linkspec::LinkSpec;
use tor_llcrypto::pk::rsa::RSAIdentity;
use tor_llcrypto::pk::rsa::RsaIdentity;
use bitflags::bitflags;
......@@ -629,11 +629,11 @@ pub struct Extend {
/// A TAP handshake to send
handshake: Vec<u8>,
/// The RSA identity of the target relay
rsaid: RSAIdentity,
rsaid: RsaIdentity,
}
impl Extend {
/// Construct a new (deprecated) extend cell
pub fn new(addr: Ipv4Addr, port: u16, handshake: Vec<u8>, rsaid: RSAIdentity) -> Self {
pub fn new(addr: Ipv4Addr, port: u16, handshake: Vec<u8>, rsaid: RsaIdentity) -> Self {
Extend {
addr,
port,
......
......@@ -4,7 +4,7 @@
/// 0.4.5.0-alpha-dev to dump all of its cells to the logs, and
/// running in a chutney network with "test-network-all".
use tor_cell::relaycell::{msg, RelayCmd};
use tor_llcrypto::pk::rsa::RSAIdentity;
use tor_llcrypto::pk::rsa::RsaIdentity;
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
......@@ -137,7 +137,7 @@ fn test_extend2() {
let handshake = hex::decode("03479E93EBF3FF2C58C1C9DBF2DE9DE9C2801B3E36A3E0BDB1F1A10579820243DD2E228B902940EB49EF842646E3926768C28410074BEE50A535116D657C6BFB7E5114119DC69F05DF907EF62002EA782B0A357F").unwrap();
let rsa =
RSAIdentity::from_bytes(&hex::decode("03479E93EBF3FF2C58C1C9DBF2DE9DE9C2801B3E").unwrap())
RsaIdentity::from_bytes(&hex::decode("03479E93EBF3FF2C58C1C9DBF2DE9DE9C2801B3E").unwrap())
.unwrap();
let addr = "127.0.0.1:5000".parse::<SocketAddr>().unwrap();
......@@ -158,7 +158,7 @@ fn test_extend() {
let addr = "127.0.0.1".parse::<Ipv4Addr>().unwrap();
let handshake = hex::decode("71510FC729E1DBE35586F0031D69A38FC684B26D657821EE640C299BA9F8FD38D3A3376F2DD3A79A0B73836AB4B42E5FB3BEE1383F3184A852B292626DCC64AF672A8FAEFC263C38370768EF9EA6C244BA079142D3E23835F6914DE0C7F468316C4265E109F5312987275D61E1DC831A3323195DDE70841CEE2DC30F6DCDBDABA40A75FDFB714431FC5EB8F84D4150EE2C2478A79018F18D7F30F6BB677516CF03390F5180B371DEAEBB89175798864D2130B13ED1D20B254F07").unwrap();
let rsa =
RSAIdentity::from_bytes(&hex::decode("CF555174CBE8AD62A7E764A8F3D85D40C5145ABB").unwrap())
RsaIdentity::from_bytes(&hex::decode("CF555174CBE8AD62A7E764A8F3D85D40C5145ABB").unwrap())
.unwrap();
msg(
......
......@@ -66,7 +66,7 @@ pub(crate) struct TargetInfo {
/// Copy of the ed25519 id from the underlying ChanTarget.
ed_identity: pk::ed25519::Ed25519Identity,
/// Copy of the rsa id from the underlying ChanTarget.
rsa_identity: pk::rsa::RSAIdentity,
rsa_identity: pk::rsa::RsaIdentity,
}
impl ChanTarget for TargetInfo {
......@@ -76,7 +76,7 @@ impl ChanTarget for TargetInfo {
fn ed_identity(&self) -> &pk::ed25519::Ed25519Identity {
&self.ed_identity
}
fn rsa_identity(&self) -> &pk::rsa::RSAIdentity {
fn rsa_identity(&self) -> &pk::rsa::RsaIdentity {
&self.rsa_identity
}
}
......
......@@ -196,7 +196,7 @@ impl ChanMgr {
mod test {
use super::*;
use tor_llcrypto::pk::rsa::RSAIdentity;
use tor_llcrypto::pk::rsa::RsaIdentity;
use async_trait::async_trait;
use futures::io::{AsyncRead, AsyncWrite};
......@@ -265,7 +265,7 @@ mod test {
struct Target {
addr: [std::net::SocketAddr; 1],
ed_id: Ed25519Identity,
rsa_id: RSAIdentity,
rsa_id: RsaIdentity,
}
impl ChanTarget for Target {
fn addrs(&self) -> &[SocketAddr] {
......@@ -274,7 +274,7 @@ mod test {
fn ed_identity(&self) -> &Ed25519Identity {
&self.ed_id
}
fn rsa_identity(&self) -> &RSAIdentity {
fn rsa_identity(&self) -> &RsaIdentity {
&self.rsa_id
}
}
......
......@@ -6,7 +6,7 @@
use crate::{Error, Result};
use tor_linkspec::ChanTarget;
use tor_llcrypto::pk::rsa::RSAIdentity;
use tor_llcrypto::pk::rsa::RsaIdentity;
use std::net::SocketAddr;
use std::sync::atomic::{AtomicBool, Ordering};
......@@ -20,7 +20,7 @@ pub struct FakeChannel {
#[derive(Debug)]
pub(crate) struct FakeChannelInner {
closing: AtomicBool,
want_rsa_id: Option<RSAIdentity>,
want_rsa_id: Option<RsaIdentity>,
addr: SocketAddr,
}
......
//! Descriptions objects for different kinds of directory requests
//! that we can make.
use tor_llcrypto::pk::rsa::RSAIdentity;
use tor_llcrypto::pk::rsa::RsaIdentity;
use tor_netdoc::doc::authcert::AuthCertKeyIds;
use tor_netdoc::doc::microdesc::MDDigest;
......@@ -36,7 +36,7 @@ pub struct ConsensusRequest {
/// A list of the authority identities that we believe in. We tell the
/// directory cache only to give us a consensus if it is signed by enough
/// of these authorities.
authority_ids: Vec<RSAIdentity>,
authority_ids: Vec<RsaIdentity>,
/// The publication time of the most recent consensus we have. Used to
/// generate an If-Modified-Since header so that we don't get a document
/// we already have.
......@@ -61,7 +61,7 @@ impl ConsensusRequest {
/// Add `id` to the list of authorities that this request should
/// say we believe in.
pub fn push_authority_id(&mut self, id: RSAIdentity) {
pub fn push_authority_id(&mut self, id: RsaIdentity) {
self.authority_ids.push(id);
}
......@@ -314,7 +314,7 @@ mod test {
#[test]
fn test_consensus_request() -> Result<()> {
let d1 = RSAIdentity::from_bytes(
let d1 = RsaIdentity::from_bytes(
&hex::decode("03479E93EBF3FF2C58C1C9DBF2DE9DE9C2801B3E").unwrap(),
)
.unwrap();
......
......@@ -4,7 +4,7 @@
//! consensus directory.
use serde::Deserialize;
use tor_llcrypto::pk::rsa::RSAIdentity;
use tor_llcrypto::pk::rsa::RsaIdentity;
use tor_netdoc::doc::authcert::{AuthCert, AuthCertKeyIds};
/// A single authority that signs a consensus directory.
......@@ -19,16 +19,16 @@ pub struct Authority {
/// A SHA1 digest of the DER-encoded long-term v3 RSA identity key for
/// this authority.
// TODO: It would be lovely to use a better hash for these identities.
v3ident: RSAIdentity,
v3ident: RsaIdentity,
}
impl Authority {
/// Construct information about a new authority.
pub fn new(name: String, v3ident: RSAIdentity) -> Self {
pub fn new(name: String, v3ident: RsaIdentity) -> Self {
Authority { name, v3ident }
}
/// Return the v3 identity key of this certificate.
pub fn v3ident(&self) -> &RSAIdentity {
pub fn v3ident(&self) -> &RsaIdentity {
&self.v3ident
}
/// Return true if this authority matches a given certificate.
......
......@@ -7,7 +7,7 @@ use std::net::{IpAddr, SocketAddr};
use tor_bytes::{Error, Readable, Reader, Result, Writeable, Writer};
use tor_llcrypto::pk::ed25519;
use tor_llcrypto::pk::rsa::RSAIdentity;
use tor_llcrypto::pk::rsa::RsaIdentity;
/// A piece of information about a relay and how to connect to it.
#[non_exhaustive]
......@@ -16,7 +16,7 @@ pub enum LinkSpec {
/// The TCP address of an OR Port for a relay
OrPort(IpAddr, u16),
/// The RSA identity fingerprint of the relay
RSAId(RSAIdentity),
RSAId(RsaIdentity),
/// The Ed25519 identity of the relay
Ed25519Id(ed25519::Ed25519Identity),
/// A link specifier that we didn't recognize
......@@ -112,8 +112,8 @@ impl From<SocketAddr> for LinkSpec {
(&sa).into()
}
}
impl From<RSAIdentity> for LinkSpec {
fn from(id: RSAIdentity) -> Self {
impl From<RsaIdentity> for LinkSpec {
fn from(id: RsaIdentity) -> Self {
LinkSpec::RSAId(id)
}
}
......@@ -181,7 +181,7 @@ mod test {
2, 20, 104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33, 33, 33, 33, 33,
33, 33, 33, 33,
],
&LinkSpec::RSAId(RSAIdentity::from_bytes(b"hello world!!!!!!!!!").unwrap()),
&LinkSpec::RSAId(RsaIdentity::from_bytes(b"hello world!!!!!!!!!").unwrap()),
);
let key = ed25519::PublicKey::from_bytes(&hex!(
"B440EEDB32D5C89EF21D6B16BE85A658774CE5992355737411678EE1041BDFBA"
......
......@@ -26,7 +26,7 @@ pub trait ChanTarget {
self.ed_identity().try_into().ok()
}
/// Return the RSA identity for this relay.
fn rsa_identity(&self) -> &pk::rsa::RSAIdentity;
fn rsa_identity(&self) -> &pk::rsa::RsaIdentity;
}
/// Information about a Tor relay used to extend a circuit to it.
......@@ -63,7 +63,7 @@ mod test {
struct Example {
addrs: Vec<SocketAddr>,
ed_id: pk::ed25519::Ed25519Identity,
rsa_id: pk::rsa::RSAIdentity,
rsa_id: pk::rsa::RsaIdentity,
ntor: pk::curve25519::PublicKey,
pv: tor_protover::Protocols,
}
......@@ -74,7 +74,7 @@ mod test {
fn ed_identity(&self) -> &pk::ed25519::Ed25519Identity {
&self.ed_id
}
fn rsa_identity(&self) -> &pk::rsa::RSAIdentity {
fn rsa_identity(&self) -> &pk::rsa::RsaIdentity {
&self.rsa_id
}
}
......@@ -100,7 +100,7 @@ mod test {
))
.unwrap()
.into(),
rsa_id: pk::rsa::RSAIdentity::from_bytes(&hex!(
rsa_id: pk::rsa::RsaIdentity::from_bytes(&hex!(
"1234567890abcdef12341234567890abcdef1234"
))
.unwrap(),
......@@ -129,7 +129,7 @@ mod test {
assert_eq!(
specs[1],
LinkSpec::RSAId(
pk::rsa::RSAIdentity::from_bytes(&hex!("1234567890abcdef12341234567890abcdef1234"))
pk::rsa::RsaIdentity::from_bytes(&hex!("1234567890abcdef12341234567890abcdef1234"))
.unwrap()
)
);
......
......@@ -27,31 +27,31 @@ pub const RSA_ID_LEN: usize = 20;
/// identity key. These are used all over the Tor protocol.
#[derive(Clone, Copy, Hash, Zeroize, Ord, PartialOrd)]
#[allow(clippy::derive_hash_xor_eq)]
pub struct RSAIdentity {
pub struct RsaIdentity {
/// SHA1 digest of a DER encoded public key.
id: [u8; RSA_ID_LEN],
}
impl PartialEq<RSAIdentity> for RSAIdentity {
fn eq(&self, rhs: &RSAIdentity) -> bool {
impl PartialEq<RsaIdentity> for RsaIdentity {
fn eq(&self, rhs: &RsaIdentity) -> bool {
self.id.ct_eq(&rhs.id).unwrap_u8() == 1
}
}
impl Eq for RSAIdentity {}
impl Eq for RsaIdentity {}
impl fmt::Display for RSAIdentity {
impl fmt::Display for RsaIdentity {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "${}", hex::encode(&self.id[..]))
}
}
impl fmt::Debug for RSAIdentity {
impl fmt::Debug for RsaIdentity {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "RSAIdentity {{ ${} }}", hex::encode(&self.id[..]))
write!(f, "RsaIdentity {{ ${} }}", hex::encode(&self.id[..]))
}
}
impl serde::Serialize for RSAIdentity {
impl serde::Serialize for RsaIdentity {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
......@@ -64,16 +64,16 @@ impl serde::Serialize for RSAIdentity {
}
}
impl<'de> serde::Deserialize<'de> for RSAIdentity {
impl<'de> serde::Deserialize<'de> for RsaIdentity {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
if deserializer.is_human_readable() {
/// Deserialization helper
struct RSAIdentityVisitor;
impl<'de> serde::de::Visitor<'de> for RSAIdentityVisitor {
type Value = RSAIdentity;
struct RsaIdentityVisitor;
impl<'de> serde::de::Visitor<'de> for RsaIdentityVisitor {
type Value = RsaIdentity;
fn expecting(&self, fmt: &mut std::fmt::Formatter<'_>) -> fmt::Result {
fmt.write_str("hex-encoded RSA identity")
}
......@@ -82,17 +82,17 @@ impl<'de> serde::Deserialize<'de> for RSAIdentity {
E: serde::de::Error,
{
let bytes = hex::decode(s).map_err(E::custom)?;
RSAIdentity::from_bytes(&bytes)
RsaIdentity::from_bytes(&bytes)
.ok_or_else(|| E::custom("wrong length for RSA identity"))
}
}
deserializer.deserialize_str(RSAIdentityVisitor)
deserializer.deserialize_str(RsaIdentityVisitor)
} else {
/// Deserialization helper
struct RSAIdentityVisitor;
impl<'de> serde::de::Visitor<'de> for RSAIdentityVisitor {
type Value = RSAIdentity;
struct RsaIdentityVisitor;
impl<'de> serde::de::Visitor<'de> for RsaIdentityVisitor {
type Value = RsaIdentity;
fn expecting(&self, fmt: &mut std::fmt::Formatter<'_>) -> fmt::Result {
fmt.write_str("RSA identity")
}
......@@ -100,38 +100,38 @@ impl<'de> serde::Deserialize<'de> for RSAIdentity {
where
E: serde::de::Error,
{
RSAIdentity::from_bytes(&bytes)
RsaIdentity::from_bytes(&bytes)
.ok_or_else(|| E::custom("wrong length for RSA identity"))
}
}
deserializer.deserialize_bytes(RSAIdentityVisitor)
deserializer.deserialize_bytes(RsaIdentityVisitor)
}
}
}
impl RSAIdentity {
/// Expose and RSAIdentity as a slice of bytes.
impl RsaIdentity {
/// Expose and RsaIdentity as a slice of bytes.
pub fn as_bytes(&self) -> &[u8] {
&self.id[..]
}
/// Construct an RSAIdentity from a slice of bytes.
/// Construct an RsaIdentity from a slice of bytes.
///
/// Returns None if the input is not of the correct length.
///
/// ```
/// use tor_llcrypto::pk::rsa::RSAIdentity;
/// use tor_llcrypto::pk::rsa::RsaIdentity;
///
/// let bytes = b"xyzzyxyzzyxyzzyxyzzy";
/// let id = RSAIdentity::from_bytes(bytes);
/// let id = RsaIdentity::from_bytes(bytes);
/// assert_eq!(id.unwrap().as_bytes(), bytes);
///
/// let truncated = b"xyzzy";
/// let id = RSAIdentity::from_bytes(truncated);
/// let id = RsaIdentity::from_bytes(truncated);
/// assert_eq!(id, None);
/// ```
pub fn from_bytes(bytes: &[u8]) -> Option<Self> {
if bytes.len() == RSA_ID_LEN {
Some(RSAIdentity {
Some(RsaIdentity {
id: *array_ref![bytes, 0, RSA_ID_LEN],
})
} else {
......@@ -140,9 +140,9 @@ impl RSAIdentity {
}
}
impl From<[u8; 20]> for RSAIdentity {
fn from(id: [u8; 20]) -> RSAIdentity {
RSAIdentity { id }
impl From<[u8; 20]> for RsaIdentity {
fn from(id: [u8; 20]) -> RsaIdentity {
RsaIdentity { id }
}
}
......@@ -226,17 +226,17 @@ impl PublicKey {
simple_asn1::to_der(&asn1).expect("RSA key not encodeable as DER")
}
/// Compute the RSAIdentity for this public key.
pub fn to_rsa_identity(&self) -> RSAIdentity {
/// Compute the RsaIdentity for this public key.
pub fn to_rsa_identity(&self) -> RsaIdentity {
use crate::d::Sha1;
use digest::Digest;
let id = Sha1::digest(&self.to_der()).into();
RSAIdentity { id }
RsaIdentity { id }
}
}
/// An RSA signature plus all the information needed to validate it.
pub struct ValidatableRSASignature {
pub struct ValidatableRsaSignature {
/// The key that allegedly signed this signature
key: PublicKey,
/// The signature in question
......@@ -245,10 +245,10 @@ pub struct ValidatableRSASignature {
expected_hash: Vec<u8>,
}
impl ValidatableRSASignature {
/// Construct a new ValidatableRSASignature.
impl ValidatableRsaSignature {
/// Construct a new ValidatableRsaSignature.
pub fn new(key: &PublicKey, sig: &[u8], expected_hash: &[u8]) -> Self {
ValidatableRSASignature {
ValidatableRsaSignature {
key: key.clone(),
sig: sig.into(),
expected_hash: expected_hash.into(),
......@@ -256,7 +256,7 @@ impl ValidatableRSASignature {
}
}
impl super::ValidatableSignature for ValidatableRSASignature {
impl super::ValidatableSignature for ValidatableRsaSignature {
fn is_valid(&self) -> bool {
self.key
.verify(&self.expected_hash[..], &self.sig[..])
......
......@@ -81,7 +81,7 @@ fn batch_verify() {
fn ser_de_rsaid() {
use serde_test::{assert_tokens, Configure, Token};
let rsa_id = ll::pk::rsa::RSAIdentity::from_bytes(b"example key id here!").unwrap();
let rsa_id = ll::pk::rsa::RsaIdentity::from_bytes(b"example key id here!").unwrap();
assert_tokens(
&rsa_id.readable(),
......
......@@ -533,11 +533,11 @@ qiBHRBGbtkF/Re5pb438HC/CGyuujp43oZ3CUYosJOfY/X+sD0aVAgMBAAE=";
);
assert_eq!(
format!("{:?}", public.to_rsa_identity()),
"RSAIdentity { $9367f9781da8eabbf96b691175f0e701b43c602e }"
"RsaIdentity { $9367f9781da8eabbf96b691175f0e701b43c602e }"
);
assert_eq!(
rsa::RSAIdentity::from_bytes(&hex!("9367f9781da8eabbf96b691175f0e701b43c602e")).unwrap(),
rsa::RsaIdentity::from_bytes(&hex!("9367f9781da8eabbf96b691175f0e701b43c602e")).unwrap(),
public.to_rsa_identity()
);
assert_eq!(
......@@ -546,10 +546,10 @@ qiBHRBGbtkF/Re5pb438HC/CGyuujp43oZ3CUYosJOfY/X+sD0aVAgMBAAE=";
);
assert!(
rsa::RSAIdentity::from_bytes(&hex!("67f9781da8eabbf96b691175f0e701b43c602e")).is_none()
rsa::RsaIdentity::from_bytes(&hex!("67f9781da8eabbf96b691175f0e701b43c602e")).is_none()
);
assert!(
rsa::RSAIdentity::from_bytes(&hex!("67f9781da8eabbf96b691175f0e701b43c602effff")).is_none()
rsa::RsaIdentity::from_bytes(&hex!("67f9781da8eabbf96b691175f0e701b43c602effff")).is_none()
);
assert_eq!(public.to_der(), to_der(pk_pem));
......@@ -568,7 +568,7 @@ rI2rzhqqBIhzFFaYuxyRAhkSBxCKTdl6X0k74ahT3MM=
assert!(public.verify(&digest, &to_der(sig)).is_ok());
assert!(!public.verify(&wrong_digest, &to_der(sig)).is_ok());
let val = rsa::ValidatableRSASignature::new(&public, &to_der(sig), &digest);
let val = rsa::ValidatableRsaSignature::new(&public, &to_der(sig), &digest);
assert!(val.is_valid());
}
......@@ -9,7 +9,7 @@
//! fallbacks, and replace it in the fallback::pregen module.
use tor_llcrypto::pk::ed25519::Ed25519Identity;
use tor_llcrypto::pk::rsa::RSAIdentity;
use tor_llcrypto::pk::rsa::RsaIdentity;
use serde::Deserialize;
use std::net::SocketAddr;
......@@ -24,7 +24,7 @@ use std::net::SocketAddr;
#[derive(Debug, Clone, Deserialize)]
pub struct FallbackDir {
/// RSA identity for the directory relay
rsa_identity: RSAIdentity,
rsa_identity: RsaIdentity,
/// Ed25519 identity for the directory relay
ed_identity: Ed25519Identity,
/// List of ORPorts for the directory relay
......@@ -34,7 +34,7 @@ pub struct FallbackDir {
impl FallbackDir {
/// Construct a new FallbackDir
pub fn new(
rsa_identity: RSAIdentity,
rsa_identity: RsaIdentity,
ed_identity: Ed25519Identity,
orports: Vec<SocketAddr>,
) -> Self {
......@@ -53,7 +53,7 @@ impl tor_linkspec::ChanTarget for FallbackDir {
fn ed_identity(&self) -> &Ed25519Identity {
&self.ed_identity
}
fn rsa_identity(&self) -> &RSAIdentity {
fn rsa_identity(&self) -> &RsaIdentity {
&self.rsa_identity
}
}
......@@ -26,7 +26,7 @@ pub mod params;
mod pick;
mod weight;
use ll::pk::rsa::RSAIdentity;
use ll::pk::rsa::RsaIdentity;
use tor_llcrypto as ll;
use tor_netdoc::doc::microdesc::{MDDigest, Microdesc};
use tor_netdoc::doc::netstatus::{self, MDConsensus};
......@@ -403,8 +403,8 @@ impl<'a> Relay<'a> {
pub fn id(&self) -> &ll::pk::ed25519::Ed25519Identity {
self.md.ed25519_id()
}
/// Return the RSAIdentity for this relay.
pub fn rsa_id(&self) -> &RSAIdentity {
/// Return the RsaIdentity for this relay.
pub fn rsa_id(&self) -> &RsaIdentity {
self.rs.rsa_identity()
}
/// Return true if this relay and `other` seem to be the same relay.
......@@ -463,7 +463,7 @@ impl<'a> tor_linkspec::ChanTarget for Relay<'a> {
fn ed_identity(&self) -> &ll::pk::ed25519::Ed25519Identity {
self.id()
}
fn rsa_identity(&self) -> &RSAIdentity {
fn rsa_identity(&self) -> &RsaIdentity {
self.rsa_id()
}
}
......
......@@ -15,7 +15,7 @@ use crate::{Error, Result};
use tor_checkable::{signed, timed};
use tor_llcrypto::pk::rsa;
use tor_llcrypto::{d, pk, pk::rsa::RSAIdentity};
use tor_llcrypto::{d, pk, pk::rsa::RsaIdentity};
use once_cell::sync::Lazy;
......@@ -89,9 +89,9 @@ pub struct AuthCert {
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
pub struct AuthCertKeyIds {
/// Fingerprint of identity key
pub id_fingerprint: rsa::RSAIdentity,
pub id_fingerprint: rsa::RsaIdentity,
/// Fingerprint of signing key
pub sk_fingerprint: rsa::RSAIdentity,
pub sk_fingerprint: rsa::RsaIdentity,
}