@@ -90,10 +90,6 @@ impl Friend {
9090/// Friend connections module that handles friends and their connections.
9191#[ derive( Clone ) ]
9292pub struct FriendConnections {
93- /// Our long term `SecretKey`.
94- real_sk : SecretKey ,
95- /// Our long term `PublicKey`.
96- real_pk : PublicKey ,
9793 /// List of friends we want to be connected to.
9894 friends : Arc < RwLock < HashMap < PublicKey , Friend > > > ,
9995 /// Sink to send a connection status when it becomes connected or
@@ -112,16 +108,12 @@ pub struct FriendConnections {
112108impl FriendConnections {
113109 /// Create new `FriendConnections`.
114110 pub fn new (
115- real_sk : SecretKey ,
116- real_pk : PublicKey ,
117111 dht : DhtServer ,
118112 tcp_connections : TcpConnections ,
119113 onion_client : OnionClient ,
120114 net_crypto : NetCrypto ,
121115 ) -> Self {
122116 FriendConnections {
123- real_sk,
124- real_pk,
125117 friends : Arc :: new ( RwLock :: new ( HashMap :: new ( ) ) ) ,
126118 connection_status_tx : Arc :: new ( RwLock :: new ( None ) ) ,
127119 dht,
@@ -450,13 +442,11 @@ mod tests {
450442 lossy_tx,
451443 dht_pk,
452444 dht_sk,
453- real_pk : real_pk . clone ( ) ,
454- real_sk : real_sk . clone ( ) ,
445+ real_pk,
446+ real_sk,
455447 precomputed_keys,
456448 } ) ;
457449 let friend_connections = FriendConnections :: new (
458- real_sk,
459- real_pk,
460450 dht,
461451 tcp_connections,
462452 onion_client,
@@ -961,7 +951,7 @@ mod tests {
961951 let run_future = friend_connections. run ( )
962952 . map ( Result :: unwrap) ;
963953
964- let precomputed_key = SalsaBox :: new ( & friend_connections. real_pk , & friend_sk) ;
954+ let precomputed_key = SalsaBox :: new ( friend_connections. net_crypto . real_pk ( ) , & friend_sk) ;
965955 let cookie = friend_connections. net_crypto . get_cookie ( & mut rng, friend_pk. clone ( ) , friend_dht_pk) ;
966956 let sent_nonce = SalsaBox :: generate_nonce ( & mut rng) . into ( ) ;
967957 let friend_session_sk = SecretKey :: generate ( & mut rng) ;
0 commit comments