Skip to content

Commit 2e6a786

Browse files
committed
refactor: SMP improvements
1 parent 98be537 commit 2e6a786

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

core/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282

8383
# hash parameters
8484
ARGON2_MEMORY = 1 * 1024**3 # GB
85-
ARGON2_ITERS = 4
85+
ARGON2_ITERS = 25
8686
ARGON2_OUTPUT_LEN = 64 # bytes
8787
ARGON2_SALT_LEN = 16 # bytes (Must be always 16 for interoperability with implementations using libsodium.)
8888
ARGON2_LANES = 4

ui/smp_question_window.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,27 @@ def __init__(self, master, contact_id, question):
1919

2020

2121
self.title("Answer Verification Question")
22-
self.geometry("400x200")
22+
self.geometry("440x240")
2323
self.configure(bg="black")
2424

25+
# Warning label
26+
tk.Label(
27+
self,
28+
text=f"`{contact_id}` wants to verify you.\nCommunicate out-of-band if you don't know an answer.",
29+
fg="white",
30+
bg="black",
31+
font=("Helvetica", 10),
32+
wraplength=380,
33+
justify="left"
34+
).pack(pady=(10, 10))
35+
36+
37+
tk.Label(self, text="Question:", font=("Helvetica", 11), fg="white", bg="black", anchor="w").pack(fill="x", padx=20)
2538
# Question label
2639
# :SMP_QUESTION_MAX_LEN to ensure no weird visual effects or even bufferoverflows can be exploited in the underlying tkinter library.
2740
tk.Label(
2841
self,
29-
text="Question: " + question[:SMP_QUESTION_MAX_LEN],
42+
text=question[:SMP_QUESTION_MAX_LEN],
3043
fg="white",
3144
bg="black",
3245
font=("Helvetica", 10),
@@ -63,6 +76,7 @@ def submit(self):
6376
messagebox.showerror("Error", "You need to provide an answer.")
6477
return
6578

79+
self.destroy()
80+
6681
smp_step_4_answer_provided(self.master.user_data, self.master.user_data_lock, self.contact_id, answer, self.master.ui_queue)
6782

68-
self.destroy()

ui/smp_setup_window.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self, master, contact_id):
2323
# Instructions label
2424
tk.Label(
2525
self,
26-
text="Pick a question that only you and your contact would know.\nCommunicate out-of-band if needed. Avoid anything guessable. No birthdays. No public facts.",
26+
text="Ask a question that only you and your contact would know.\nCommunicate out-of-band if needed. Avoid anything guessable. No birthdays. No public facts.",
2727
fg="white",
2828
bg="black",
2929
font=("Helvetica", 10),

0 commit comments

Comments
 (0)