comparison testharness/src/bin/testharness.rs @ 167:0cabe7b94a4f

Check for old_authtok in change_authtok to emulate real behavior.
author Paul Fisher <paul@pfish.zone>
date Tue, 15 Jul 2025 00:39:08 -0400
parents 2f5913131295
children e27c5c667a5a
comparison
equal deleted inserted replaced
166:2f5913131295 167:0cabe7b94a4f
41 self.username_requested.set(true) 41 self.username_requested.set(true)
42 } 42 }
43 Exchange::MaskedPrompt(p) => { 43 Exchange::MaskedPrompt(p) => {
44 let answer = if self.changing_password.get() { 44 let answer = if self.changing_password.get() {
45 let prompts = self.change_prompt_count.get(); 45 let prompts = self.change_prompt_count.get();
46 eprintln!("CHANGING PASSWORD PROMPT {prompts}");
47 eprintln!("-> {p:?}");
46 self.change_prompt_count.set(prompts + 1); 48 self.change_prompt_count.set(prompts + 1);
47 match prompts { 49 match prompts {
48 0 => "mistake", 50 0 => "old token!",
49 1 => "mismatch", 51 1 => "mistake",
50 2 => "acceptable", 52 2 => "mismatch",
51 3 => "acceptable", 53 3 => "old token!",
54 4 => "acceptable",
55 5 => "acceptable",
52 _ => panic!("unexpected number of prompts!"), 56 _ => panic!("unexpected number of prompts!"),
53 } 57 }
54 } else if self.wrong_password { 58 } else if self.wrong_password {
55 "bogus" 59 "bogus"
56 } else { 60 } else {