Skip to content

Commit c2df003

Browse files
committed
refactor: rename fingerprint_equals_sender to verify_sender_by_fingerprint
1 parent 457b012 commit c2df003

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/securejoin.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ async fn info_chat_id(context: &Context, contact_id: ContactId) -> Result<ChatId
203203

204204
/// Checks fingerprint and marks the contact as forward verified
205205
/// if fingerprint matches.
206-
async fn fingerprint_equals_sender(
206+
async fn verify_sender_by_fingerprint(
207207
context: &Context,
208208
fingerprint: &Fingerprint,
209209
contact_id: ContactId,
@@ -374,7 +374,7 @@ pub(crate) async fn handle_securejoin_handshake(
374374
.await?;
375375
return Ok(HandshakeMessage::Ignore);
376376
}
377-
if !fingerprint_equals_sender(context, &fingerprint, contact_id).await? {
377+
if !verify_sender_by_fingerprint(context, &fingerprint, contact_id).await? {
378378
could_not_establish_secure_connection(
379379
context,
380380
contact_id,

src/securejoin/bobstate.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use anyhow::Result;
1111
use rusqlite::Connection;
1212

1313
use super::qrinvite::QrInvite;
14-
use super::{encrypted_and_signed, fingerprint_equals_sender};
14+
use super::{encrypted_and_signed, verify_sender_by_fingerprint};
1515
use crate::chat::{self, ChatId};
1616
use crate::config::Config;
1717
use crate::contact::{Contact, Origin};
@@ -90,7 +90,8 @@ impl BobState {
9090
chat_id: ChatId,
9191
) -> Result<(Self, BobHandshakeStage, Vec<Self>)> {
9292
let (stage, next) =
93-
if fingerprint_equals_sender(context, invite.fingerprint(), invite.contact_id()).await?
93+
if verify_sender_by_fingerprint(context, invite.fingerprint(), invite.contact_id())
94+
.await?
9495
{
9596
// The scanned fingerprint matches Alice's key, we can proceed to step 4b.
9697
info!(context, "Taking securejoin protocol shortcut");
@@ -268,8 +269,12 @@ impl BobState {
268269
.await?;
269270
return Ok(Some(BobHandshakeStage::Terminated(reason)));
270271
}
271-
if !fingerprint_equals_sender(context, self.invite.fingerprint(), self.invite.contact_id())
272-
.await?
272+
if !verify_sender_by_fingerprint(
273+
context,
274+
self.invite.fingerprint(),
275+
self.invite.contact_id(),
276+
)
277+
.await?
273278
{
274279
self.update_next(&context.sql, SecureJoinStep::Terminated)
275280
.await?;

0 commit comments

Comments
 (0)