team-ljyzipelo

공개

실제 작업자의 암호 요청과 암호 ZIP 생성 옵션을 화면에 연결함

작성자
호시노 히나타
작성 시각
커밋
da21a845ed7ff5a58b542feaccc12cb5adf07eec
부모
4160fcc
이 시점의 파일 보기

변경된 파일 8개

+491-30
수정experiments/rust-ui-memory-app/Cargo.lock+68-0
@@ -116,6 +116,18 @@ version = "2.0.1"
116116source = "registry+https://github.com/rust-lang/crates.io-index"
117117checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
118118
119추가: [[package]]
120추가: name = "aes"
121추가: version = "0.8.4"
122추가: source = "registry+https://github.com/rust-lang/crates.io-index"
123추가: checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
124추가: dependencies = [
125추가: "cfg-if",
126추가: "cipher",
127추가: "cpufeatures",
128추가: "zeroize",
129추가: ]
130추가:
119131[[package]]
120132name = "ahash"
121133version = "0.8.12"
@@ -555,6 +567,16 @@ dependencies = [
555567 "libc",
556568]
557569
570추가: [[package]]
571추가: name = "cipher"
572추가: version = "0.4.4"
573추가: source = "registry+https://github.com/rust-lang/crates.io-index"
574추가: checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
575추가: dependencies = [
576추가: "crypto-common",
577추가: "inout",
578추가: ]
579추가:
558580[[package]]
559581name = "clipboard-win"
560582version = "5.4.3"
@@ -704,6 +726,7 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
704726dependencies = [
705727 "block-buffer",
706728 "crypto-common",
729추가: "subtle",
707730]
708731
709732[[package]]
@@ -1398,6 +1421,15 @@ version = "0.4.3"
13981421source = "registry+https://github.com/rust-lang/crates.io-index"
13991422checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
14001423
1424추가: [[package]]
1425추가: name = "hmac"
1426추가: version = "0.12.1"
1427추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1428추가: checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
1429추가: dependencies = [
1430추가: "digest",
1431추가: ]
1432추가:
14011433[[package]]
14021434name = "image"
14031435version = "0.25.10"
@@ -1422,6 +1454,15 @@ dependencies = [
14221454 "hashbrown 0.17.1",
14231455]
14241456
1457추가: [[package]]
1458추가: name = "inout"
1459추가: version = "0.1.4"
1460추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1461추가: checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
1462추가: dependencies = [
1463추가: "generic-array",
1464추가: ]
1465추가:
14251466[[package]]
14261467name = "itertools"
14271468version = "0.15.0"
@@ -2147,6 +2188,16 @@ version = "0.1.1"
21472188source = "registry+https://github.com/rust-lang/crates.io-index"
21482189checksum = "73072a9470554c8e794778acece2312661218aaabb635600957d952cf01c716e"
21492190
2191추가: [[package]]
2192추가: name = "pbkdf2"
2193추가: version = "0.12.2"
2194추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2195추가: checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
2196추가: dependencies = [
2197추가: "digest",
2198추가: "hmac",
2199추가: ]
2200추가:
21502201[[package]]
21512202name = "peniko"
21522203version = "0.6.1"
@@ -2588,6 +2639,17 @@ dependencies = [
25882639 "syn 3.0.10",
25892640]
25902641
2642추가: [[package]]
2643추가: name = "sha1"
2644추가: version = "0.10.7"
2645추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2646추가: checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8"
2647추가: dependencies = [
2648추가: "cfg-if",
2649추가: "cpufeatures",
2650추가: "digest",
2651추가: ]
2652추가:
25912653[[package]]
25922654name = "sha2"
25932655version = "0.10.9"
@@ -3952,7 +4014,13 @@ dependencies = [
39524014name = "zipelo-archive-worker"
39534015version = "0.1.0"
39544016dependencies = [
4017추가: "aes",
4018추가: "hmac",
4019추가: "pbkdf2",
4020추가: "sha1",
39554021 "sha2",
4022추가: "subtle",
4023추가: "zeroize",
39564024 "zlib-rs",
39574025]
39584026
수정experiments/rust-ui-memory-app/src/archive_screen.rs+36-8
@@ -11,6 +11,8 @@ pub struct ArchiveApp {
1111 sources: String,
1212 zip_output: String,
1313 password: String,
14추가: password_challenge: Option<u64>,
15추가: aes256: bool,
1416 create: bool,
1517 open: bool,
1618 selected_only: bool,
@@ -28,6 +30,8 @@ impl ArchiveApp {
2830 sources: String::new(),
2931 zip_output: String::new(),
3032 password: String::new(),
33추가: password_challenge: None,
34추가: aes256: false,
3135 create: false,
3236 open: false,
3337 selected_only: false,
@@ -39,8 +43,12 @@ impl ArchiveApp {
3943 }
4044 app
4145 }
46추가: fn clear_password(&mut self) {
47추가: let mut bytes = std::mem::take(&mut self.password).into_bytes();
48추가: bytes.fill(0);
49추가: }
4250 pub fn open_path(&mut self, archive: PathBuf) {
43삭제: self.password.clear();
51추가: self.clear_password();
4452 self.model
4553 .begin(Start::List { archive }, self.factory.as_mut());
4654 }
@@ -65,9 +73,12 @@ impl ArchiveApp {
6573impl ArchiveApp {
6674 pub fn show(&mut self, root: &mut egui::Ui) {
6775 self.model.poll();
68삭제: if self.model.challenge.is_none() {
69삭제: self.password.clear();
76추가: let challenge = self.model.challenge.map(|(id, _, _)| id);
77추가: let new_challenge = challenge != self.password_challenge;
78추가: if new_challenge || challenge.is_none() {
79추가: self.clear_password();
7080 }
81추가: self.password_challenge = challenge;
7182 let ctx = root.ctx().clone();
7283 let dropped = ctx.input(|i| {
7384 i.raw
@@ -104,7 +115,7 @@ impl ArchiveApp {
104115 .add_enabled(self.model.busy(), egui::Button::new("취소 요청"))
105116 .clicked()
106117 {
107삭제: self.password.clear();
118추가: self.clear_password();
108119 self.model.cancel();
109120 }
110121 });
@@ -267,7 +278,7 @@ impl ArchiveApp {
267278 ui.selectable_value(&mut self.method, Method::Deflate, "압축");
268279 ui.selectable_value(&mut self.method, Method::Store, "묶기");
269280 });
270삭제: ui.label("암호 ZIP 생성은 작업자 지원 후 활성화됩니다");
281추가: ui.checkbox(&mut self.aes256, "암호로 보호");
271282 if ui.button("ZIP 만들기").clicked() {
272283 let sources = self
273284 .sources
@@ -287,7 +298,7 @@ impl ArchiveApp {
287298 sources,
288299 output_file: self.zip_output.clone().into(),
289300 method: self.method,
290삭제: aes256: false,
301추가: aes256: self.aes256,
291302 },
292303 self.factory.as_mut(),
293304 ) {
@@ -308,12 +319,23 @@ impl ArchiveApp {
308319 })
309320 .collapsible(false)
310321 .show(&ctx, |ui| {
311삭제: ui.label(format!("암호 입력 요청 {attempt}"));
322추가: ui.label(if encrypt {
323추가: "사용할 암호를 입력하세요"
324추가: } else if attempt > 1 {
325추가: "암호가 맞지 않습니다. 다시 입력하세요"
326추가: } else {
327추가: "암호를 입력하세요"
328추가: });
329추가: ui.label("암호");
312330 let edit = ui.add(
313331 egui::TextEdit::singleline(&mut self.password)
314332 .password(true)
333추가: .id(egui::Id::new("archive-password-input"))
315334 .char_limit(1024),
316335 );
336추가: if new_challenge {
337추가: edit.request_focus();
338추가: }
317339 if ui.button("암호 전달").clicked()
318340 || (edit.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter)))
319341 {
@@ -321,7 +343,7 @@ impl ArchiveApp {
321343 self.model.password(text);
322344 }
323345 if ui.button("작업 취소").clicked() {
324삭제: self.password.clear();
346추가: self.clear_password();
325347 self.model.cancel();
326348 }
327349 });
@@ -381,3 +403,9 @@ impl eframe::App for ArchiveApp {
381403 self.show(root);
382404 }
383405}
406추가:
407추가: impl Drop for ArchiveApp {
408추가: fn drop(&mut self) {
409추가: self.clear_password();
410추가: }
411추가: }
수정experiments/rust-ui-memory-app/src/archive_ui.rs+4-4
@@ -53,10 +53,12 @@ pub enum Start {
5353pub struct Secret(Vec<u8>);
5454impl Secret {
5555 pub fn new(text: String) -> Result<Self, &'static str> {
56삭제: if text.is_empty() || text.len() > 1024 {
56추가: let mut bytes = text.into_bytes();
57추가: if bytes.is_empty() || bytes.len() > 1024 {
58추가: bytes.fill(0);
5759 return Err("암호는 UTF-8 1~1024바이트로 입력하세요");
5860 }
59삭제: Ok(Self(text.into_bytes()))
61추가: Ok(Self(bytes))
6062 }
6163 pub fn as_bytes(&self) -> &[u8] {
6264 &self.0
@@ -322,12 +324,10 @@ impl Model {
322324 Start::CreateZip {
323325 sources,
324326 output_file,
325삭제: aes256,
326327 ..
327328 } => {
328329 !sources.is_empty()
329330 && output_file.is_absolute()
330삭제: && (!aes256 || self.encryption)
331331 && sources
332332 .iter()
333333 .all(|(p, n)| p.is_absolute() && valid_relative(n))
수정tests/rust-app-real-worker/Cargo.lock+80-0
@@ -2,6 +2,18 @@
22# It is not intended for manual editing.
33version = 4
44
5추가: [[package]]
6추가: name = "aes"
7추가: version = "0.8.4"
8추가: source = "registry+https://github.com/rust-lang/crates.io-index"
9추가: checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
10추가: dependencies = [
11추가: "cfg-if",
12추가: "cipher",
13추가: "cpufeatures",
14추가: "zeroize",
15추가: ]
16추가:
517[[package]]
618name = "block-buffer"
719version = "0.10.4"
@@ -17,6 +29,16 @@ version = "1.0.5"
1729source = "registry+https://github.com/rust-lang/crates.io-index"
1830checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
1931
32추가: [[package]]
33추가: name = "cipher"
34추가: version = "0.4.4"
35추가: source = "registry+https://github.com/rust-lang/crates.io-index"
36추가: checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
37추가: dependencies = [
38추가: "crypto-common",
39추가: "inout",
40추가: ]
41추가:
2042[[package]]
2143name = "cpufeatures"
2244version = "0.2.17"
@@ -44,6 +66,7 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
4466dependencies = [
4567 "block-buffer",
4668 "crypto-common",
69추가: "subtle",
4770]
4871
4972[[package]]
@@ -56,12 +79,51 @@ dependencies = [
5679 "version_check",
5780]
5881
82추가: [[package]]
83추가: name = "hmac"
84추가: version = "0.12.1"
85추가: source = "registry+https://github.com/rust-lang/crates.io-index"
86추가: checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
87추가: dependencies = [
88추가: "digest",
89추가: ]
90추가:
91추가: [[package]]
92추가: name = "inout"
93추가: version = "0.1.4"
94추가: source = "registry+https://github.com/rust-lang/crates.io-index"
95추가: checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
96추가: dependencies = [
97추가: "generic-array",
98추가: ]
99추가:
59100[[package]]
60101name = "libc"
61102version = "0.2.191"
62103source = "registry+https://github.com/rust-lang/crates.io-index"
63104checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
64105
106추가: [[package]]
107추가: name = "pbkdf2"
108추가: version = "0.12.2"
109추가: source = "registry+https://github.com/rust-lang/crates.io-index"
110추가: checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
111추가: dependencies = [
112추가: "digest",
113추가: "hmac",
114추가: ]
115추가:
116추가: [[package]]
117추가: name = "sha1"
118추가: version = "0.10.7"
119추가: source = "registry+https://github.com/rust-lang/crates.io-index"
120추가: checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8"
121추가: dependencies = [
122추가: "cfg-if",
123추가: "cpufeatures",
124추가: "digest",
125추가: ]
126추가:
65127[[package]]
66128name = "sha2"
67129version = "0.10.9"
@@ -73,6 +135,12 @@ dependencies = [
73135 "digest",
74136]
75137
138추가: [[package]]
139추가: name = "subtle"
140추가: version = "2.6.1"
141추가: source = "registry+https://github.com/rust-lang/crates.io-index"
142추가: checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
143추가:
76144[[package]]
77145name = "typenum"
78146version = "1.20.1"
@@ -85,11 +153,23 @@ version = "0.9.5"
85153source = "registry+https://github.com/rust-lang/crates.io-index"
86154checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
87155
156추가: [[package]]
157추가: name = "zeroize"
158추가: version = "1.9.1"
159추가: source = "registry+https://github.com/rust-lang/crates.io-index"
160추가: checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879"
161추가:
88162[[package]]
89163name = "zipelo-archive-worker"
90164version = "0.1.0"
91165dependencies = [
166추가: "aes",
167추가: "hmac",
168추가: "pbkdf2",
169추가: "sha1",
92170 "sha2",
171추가: "subtle",
172추가: "zeroize",
93173 "zlib-rs",
94174]
95175
수정tests/rust-app-real-worker/README.md+11-0
@@ -50,3 +50,14 @@ fixtures/는 generate.py의 Python 표준 라이브러리로 생성한 작은
5050암호 ZIP, 대용량 성능, OS sandbox, 악성 파일 전체 검증과 Windows 실기는 이 시험의 범위 밖임.
5151
5252취소와 종료 경합 회귀 시험은 실제 작업자에 List를 보낸 뒤 화면 poll 전에 취소하는 흐름을 100회 확인함. 취소 파이프 쓰기가 실패해도 검증된 Terminal과 성공 종료가 있으면 원래 결과를 보존하며, Terminal이 없는 조기 종료는 계속 실패로 처리함. 취소 쓰기 오류 판단을 미루어도 EOF와 child wait 전에는 닫기나 작업 교체를 허용하지 않음.
53추가:
54추가: 암호 화면 흐름
55추가:
56추가: password_flows.rs는 공개 시험 암호 fixture-password를 사용하는 기존 합성 ZIP 6개로
57추가: ZipCrypto와 AES의 Store/Deflate 목록 및 해제를 실제 화면 위젯과 작업자로 확인함.
58추가: 목록은 암호 없이 표시하며 해제 시 작업자의 challenge_id와 attempt로 암호를 요청함.
59추가: 틀린 암호 뒤 재입력, 3회 실패, 빈 입력과 UTF-8 바이트 한도 초과, 대기 중 취소,
60추가: 첫 실행의 AES ZIP 생성 및 재열기/해제를 검증함. 실패와 취소 중 출력이 없고 기존 파일과
61추가: 원본이 보존되며 Terminal, 양쪽 EOF 및 child wait 후 연결이 정리되는지 확인함.
62추가: 암호 표시를 가리고 재요청, 취소 및 창 해제 때 앱이 소유한 입력 버퍼를 지움.
63추가: Windows 실행이나 네이티브 OS 창 입력 자동화 검증은 포함하지 않음.
수정tests/rust-app-real-worker/flows.rs+2-0
@@ -266,6 +266,8 @@ mod screen {
266266 );
267267 }
268268 }
269추가: include!("password_flows.rs");
270추가:
269271 fn archive_flow(name: &str, format: Format) {
270272 let scratch = Scratch::new();
271273 let fixture = Path::new(env!("CARGO_MANIFEST_DIR"))
추가tests/rust-app-real-worker/password_flows.rs+268-0
@@ -0,0 +1,268 @@
1추가: const FIXTURE_PASSWORD: &str = "fixture-password";
2추가: fn encrypted_fixture(scratch: &Scratch, name: &str) -> PathBuf {
3추가: let archive = scratch.path(name);
4추가: fs::copy(
5추가: Path::new(env!("CARGO_MANIFEST_DIR"))
6추가: .join("../../tests/rust-archive-worker/fixtures")
7추가: .join(name),
8추가: &archive,
9추가: )
10추가: .unwrap();
11추가: archive
12추가: }
13추가: impl Screen {
14추가: fn password_request(&mut self, expected_attempt: u32, encrypt: bool) -> u64 {
15추가: let deadline = Instant::now() + Duration::from_secs(10);
16추가: loop {
17추가: self.render(vec![]);
18추가: assert!(self.app.model.busy(), "{}", self.app.model.status());
19추가: if let Some((id, attempt, purpose)) = self.app.model.challenge {
20추가: assert_eq!(attempt, expected_attempt);
21추가: assert_eq!(purpose, encrypt);
22추가: self.render(vec![]);
23추가: return id;
24추가: }
25추가: assert!(Instant::now() < deadline);
26추가: std::thread::sleep(Duration::from_millis(2));
27추가: }
28추가: }
29추가: fn password_answer(&mut self, text: &str) {
30추가: self.render(vec![]);
31추가: let input = self
32추가: .context
33추가: .read_response(egui::Id::new("archive-password-input"))
34추가: .expect("암호 입력란이 없음")
35추가: .rect
36추가: .center();
37추가: self.click_at(input);
38추가: let rendered = self.render(vec![
39추가: egui::Event::Key {
40추가: key: egui::Key::A,
41추가: physical_key: None,
42추가: pressed: true,
43추가: repeat: false,
44추가: modifiers: egui::Modifiers::COMMAND,
45추가: },
46추가: egui::Event::Text(text.into()),
47추가: ]);
48추가: assert!(!rendered.iter().any(|(value, _)| value.contains(text)));
49추가: self.click("암호 전달");
50추가: }
51추가: fn start_password_extract(&mut self, output: &Path) {
52추가: self.fill("출력 폴더", egui::vec2(100.0, 0.0), output);
53추가: self.click("풀기");
54추가: assert!(self.app.model.busy());
55추가: }
56추가: fn finish_password_job(&mut self, expected: Outcome) {
57추가: let deadline = Instant::now() + Duration::from_secs(10);
58추가: while self.app.model.busy() {
59추가: self.render(vec![]);
60추가: assert!(Instant::now() < deadline);
61추가: std::thread::sleep(Duration::from_millis(2));
62추가: }
63추가: assert!(self.app.model.confirmed, "{}", self.app.model.status());
64추가: assert_eq!(self.app.model.terminal.as_ref().unwrap().outcome, expected);
65추가: assert!(self.app.model.challenge.is_none());
66추가: }
67추가: fn start_encrypted_zip(&mut self, source: &Path, archive: &Path) {
68추가: self.click("ZIP 만들기");
69추가: self.fill(
70추가: "원본 파일 절대 경로 / 한 줄에 하나",
71추가: egui::vec2(0.0, 25.0),
72추가: source,
73추가: );
74추가: self.fill("저장할 ZIP 절대 경로", egui::vec2(0.0, 22.0), archive);
75추가: self.click("암호로 보호");
76추가: self.click("ZIP 만들기");
77추가: assert!(self.app.model.busy(), "{}", self.app.model.status());
78추가: }
79추가: }
80추가: #[test]
81추가: fn encrypted_zip_list_and_extract_with_actual_password_dialog() {
82추가: for name in [
83추가: "zipcrypto-store.zip",
84추가: "zipcrypto-deflate.zip",
85추가: "aes1-store.zip",
86추가: "aes1-deflate.zip",
87추가: "aes2-store.zip",
88추가: "aes2-deflate.zip",
89추가: ] {
90추가: let scratch = Scratch::new();
91추가: let archive = encrypted_fixture(&scratch, name);
92추가: let original = fs::read(&archive).unwrap();
93추가: let output = make_directory(&scratch.path("output"));
94추가: let (factory, observed) = observed_factory();
95추가: let mut screen = Screen::new(factory);
96추가: screen.open(&archive);
97추가: assert!(screen.app.model.entries.iter().all(|entry| entry.encrypted));
98추가: assert!(screen.app.model.challenge.is_none());
99추가: screen.start_password_extract(&output);
100추가: screen.password_request(1, false);
101추가: assert_eq!(fs::read_dir(&output).unwrap().count(), 0);
102추가: screen.password_answer(FIXTURE_PASSWORD);
103추가: screen.finish_password_job(Outcome::Completed);
104추가: assert_eq!(
105추가: fs::read(output.join("payload.bin")).unwrap(),
106추가: b"Zipelo encrypted interoperability\n".repeat(8)
107추가: );
108추가: assert_eq!(fs::read(archive).unwrap(), original);
109추가: assert_reaped(&observed);
110추가: }
111추가: }
112추가: #[test]
113추가: fn wrong_password_retry_clears_input_and_succeeds_without_partial_output() {
114추가: let scratch = Scratch::new();
115추가: let archive = encrypted_fixture(&scratch, "aes2-deflate.zip");
116추가: let output = make_directory(&scratch.path("output"));
117추가: let (factory, observed) = observed_factory();
118추가: let mut screen = Screen::new(factory);
119추가: screen.open(&archive);
120추가: screen.start_password_extract(&output);
121추가: let first = screen.password_request(1, false);
122추가: screen.password_answer("wrong-password");
123추가: let second = screen.password_request(2, false);
124추가: assert_ne!(first, second);
125추가: assert_eq!(fs::read_dir(&output).unwrap().count(), 0);
126추가: let labels = screen.render(vec![]);
127추가: assert!(
128추가: labels
129추가: .iter()
130추가: .any(|(value, _)| value == "암호가 맞지 않습니다. 다시 입력하세요")
131추가: );
132추가: screen.click("암호 전달");
133추가: assert_eq!(screen.app.model.challenge, Some((second, 2, false)));
134추가: assert!(
135추가: screen
136추가: .app
137추가: .model
138추가: .error
139추가: .as_ref()
140추가: .unwrap()
141추가: .contains("1~1024바이트")
142추가: );
143추가: screen.render(vec![]);
144추가: screen.password_answer(FIXTURE_PASSWORD);
145추가: screen.finish_password_job(Outcome::Completed);
146추가: assert_reaped(&observed);
147추가: }
148추가: #[test]
149추가: fn three_wrong_passwords_fail_without_writes_and_can_start_a_new_job() {
150추가: let scratch = Scratch::new();
151추가: let archive = encrypted_fixture(&scratch, "zipcrypto-deflate.zip");
152추가: let output = make_directory(&scratch.path("output"));
153추가: let (factory, observed) = observed_factory();
154추가: let mut screen = Screen::new(factory);
155추가: screen.open(&archive);
156추가: screen.start_password_extract(&output);
157추가: for attempt in 1..=3 {
158추가: screen.password_request(attempt, false);
159추가: assert_eq!(fs::read_dir(&output).unwrap().count(), 0);
160추가: screen.password_answer("wrong-password");
161추가: }
162추가: screen.finish_password_job(Outcome::Failed);
163추가: assert_eq!(
164추가: screen.app.model.terminal.as_ref().unwrap().error,
165추가: Some(ErrorCode::WrongPassword)
166추가: );
167추가: assert_eq!(fs::read_dir(&output).unwrap().count(), 0);
168추가: screen.open(&archive);
169추가: assert_reaped(&observed);
170추가: }
171추가: #[test]
172추가: fn cancel_password_extraction_waits_for_cleanup_without_writes() {
173추가: let scratch = Scratch::new();
174추가: let archive = encrypted_fixture(&scratch, "aes1-store.zip");
175추가: let output = make_directory(&scratch.path("output"));
176추가: fs::write(output.join("existing.txt"), b"preserve").unwrap();
177추가: let (factory, observed) = observed_factory();
178추가: let mut screen = Screen::new(factory);
179추가: screen.open(&archive);
180추가: screen.start_password_extract(&output);
181추가: screen.password_request(1, false);
182추가: screen.click("작업 취소");
183추가: screen.app.model.request_close();
184추가: screen.app.model.confirm_close();
185추가: assert!(matches!(
186추가: screen.app.model.close,
187추가: Close::Waiting | Close::Review
188추가: ));
189추가: screen.finish_password_job(Outcome::Cancelled);
190추가: assert_eq!(screen.app.model.close, Close::Review);
191추가: assert_eq!(fs::read(output.join("existing.txt")).unwrap(), b"preserve");
192추가: assert_eq!(fs::read_dir(output).unwrap().count(), 1);
193추가: assert_reaped(&observed);
194추가: }
195추가: #[test]
196추가: fn cold_start_creates_aes_zip_then_reopens_and_extracts_with_password() {
197추가: let scratch = Scratch::new();
198추가: let source = scratch.path("private.txt");
199추가: let payload = b"Public synthetic password flow payload\n";
200추가: fs::write(&source, payload).unwrap();
201추가: let archive = scratch.path("encrypted.zip");
202추가: let output = make_directory(&scratch.path("output"));
203추가: let (factory, observed) = observed_factory();
204추가: let mut screen = Screen::new(factory);
205추가: assert!(!screen.app.model.encryption);
206추가: screen.start_encrypted_zip(&source, &archive);
207추가: screen.password_request(1, true);
208추가: assert!(!archive.exists());
209추가: screen.password_answer(FIXTURE_PASSWORD);
210추가: screen.finish_password_job(Outcome::Completed);
211추가: let bytes = fs::read(&archive).unwrap();
212추가: assert_eq!(&bytes[..4], b"PK\x03\x04");
213추가: assert_eq!(u16::from_le_bytes(bytes[6..8].try_into().unwrap()) & 1, 1);
214추가: assert_eq!(u16::from_le_bytes(bytes[8..10].try_into().unwrap()), 99);
215추가: screen.open(&archive);
216추가: assert!(screen.app.model.entries.iter().all(|entry| entry.encrypted));
217추가: screen.start_password_extract(&output);
218추가: screen.password_request(1, false);
219추가: screen.password_answer(FIXTURE_PASSWORD);
220추가: screen.finish_password_job(Outcome::Completed);
221추가: assert_eq!(fs::read(output.join("private.txt")).unwrap(), payload);
222추가: assert_eq!(fs::read(source).unwrap(), payload);
223추가: assert_reaped(&observed);
224추가: }
225추가: #[test]
226추가: fn cancel_password_creation_does_not_create_an_archive() {
227추가: let scratch = Scratch::new();
228추가: let source = scratch.path("private.txt");
229추가: fs::write(&source, b"preserve").unwrap();
230추가: let archive = scratch.path("cancelled.zip");
231추가: let (factory, observed) = observed_factory();
232추가: let mut screen = Screen::new(factory);
233추가: screen.start_encrypted_zip(&source, &archive);
234추가: screen.password_request(1, true);
235추가: screen.click("작업 취소");
236추가: screen.finish_password_job(Outcome::Cancelled);
237추가: assert!(!archive.exists());
238추가: assert_eq!(fs::read(source).unwrap(), b"preserve");
239추가: assert_eq!(fs::read_dir(&scratch.0).unwrap().count(), 1);
240추가: assert_reaped(&observed);
241추가: }
242추가:
243추가: #[test]
244추가: fn oversized_utf8_password_stays_in_dialog_then_accepts_valid_input() {
245추가: let scratch = Scratch::new();
246추가: let archive = encrypted_fixture(&scratch, "aes2-store.zip");
247추가: let output = make_directory(&scratch.path("output"));
248추가: let (factory, observed) = observed_factory();
249추가: let mut screen = Screen::new(factory);
250추가: screen.open(&archive);
251추가: screen.start_password_extract(&output);
252추가: let id = screen.password_request(1, false);
253추가: screen.password_answer(&"가".repeat(342));
254추가: assert_eq!(screen.app.model.challenge, Some((id, 1, false)));
255추가: assert!(
256추가: screen
257추가: .app
258추가: .model
259추가: .error
260추가: .as_ref()
261추가: .unwrap()
262추가: .contains("1~1024바이트")
263추가: );
264추가: assert_eq!(fs::read_dir(&output).unwrap().count(), 0);
265추가: screen.password_answer(FIXTURE_PASSWORD);
266추가: screen.finish_password_job(Outcome::Completed);
267추가: assert_reaped(&observed);
268추가: }
수정tests/rust-app-ui/validation.json+22-18
@@ -1,28 +1,27 @@
11{
22 "command": "python3 tests/ci/run_rust.py local",
33 "platform": "linux-desktop-2",
4삭제: "base_remote_main": "3f51510fcc613c3f72e29c3b421aab178bf94186",
5삭제: "local_baseline_head": "3ef6f50",
4추가: "base_remote_main": "4160fcc4e80070b6ab9ea50c78705c0458b2384a",
5추가: "local_baseline_head": "1c1a30f8beb3658242e4c856057c70b1e4d649dd",
66 "source_state": "Tested committed integration source. Only this evidence JSON was updated after the full runner completed; hashes identify the tested code and fixtures.",
77 "linux_build_crates": 19,
88 "linux_test_targets": 19,
9삭제: "rust_tests_passed": 870,
9추가: "rust_tests_passed": 889,
1010 "new_archive_ui_tests_passed": 22,
1111 "windows_cross_build_crates": 19,
1212 "windows_runtime_tested": false,
1313 "native_visual_check": "Headless egui Context used actual widget pointer/key events and the real OS worker process on Linux. Native OS window/input automation and Windows execution were not performed.",
1414 "prior_failures": "Retained locally: first build drop API/legacy harness references; second and third egui renderer harness texture/first-frame setup; final runner passed.",
1515 "limitations": [
16삭제: "Normal ZIP/TAR.GZ listing and extraction plus ZIP creation/reopen/extraction use the actual worker executable and OS pipes.",
17삭제: "The three successful screen tests run headless egui widgets, not a native OS GUI automation session.",
18삭제: "Malformed, wrong-action, early-exit and disposal fault cases use a separate test-only probe; serialization failure and late cancellation use the actual worker.",
19삭제: "No Windows runtime, encryption ZIP, large-file performance, OS sandbox or exhaustive malicious-input validation in this frontend integration.",
20삭제: "Manual path text is UTF-8; native archive CLI/drop paths retain PathBuf and NativePath."
16추가: "Headless egui widgets with actual Linux child processes and OS pipes; no native OS window/input automation or Windows runtime.",
17추가: "Passwords are public synthetic fixture data. The tests verify masking and lifecycle cleanup, not an exhaustive process-memory audit.",
18추가: "No backend cryptography, wire contract, installer or 7z changes in this branch.",
19추가: "The UI and probe lockfiles include the existing PR67 crypto dependencies. Existing package versions remain unchanged."
2120 ],
2221 "tested_files": [
2322 {
2423 "path": "experiments/rust-ui-memory-app/Cargo.lock",
25삭제: "sha256": "791935d3b7eb17f68ccd08e35e6839e3ff42fecf9fd51cce4ce69fb7bb717197"
24추가: "sha256": "f5515522ce9eebb3918f9bb4905a4aa8ae5e299c544ad5a14327ce1fcda3ec1f"
2625 },
2726 {
2827 "path": "experiments/rust-ui-memory-app/Cargo.toml",
@@ -34,11 +33,11 @@
3433 },
3534 {
3635 "path": "experiments/rust-ui-memory-app/src/archive_screen.rs",
37삭제: "sha256": "04b7a55c7405d89467fc821db27e0714fb0aa00612e614835b5fee901e5ca940"
36추가: "sha256": "5eb6fb41a79cf0997804e2a2d689b2cbf393efa421f5ad82afe900663bd5f45d"
3837 },
3938 {
4039 "path": "experiments/rust-ui-memory-app/src/archive_ui.rs",
41삭제: "sha256": "e37e59f6abe56e19551b5de1b5a95e56c5a1448c0aa4387bff38c4f18d319d46"
40추가: "sha256": "78bb576ea372739450bef8d135db69b9ba66b16191b377cf4996b97fbe46ae75"
4241 },
4342 {
4443 "path": "experiments/rust-ui-memory-app/src/desktop.rs",
@@ -54,7 +53,7 @@
5453 },
5554 {
5655 "path": "tests/rust-app-real-worker/Cargo.lock",
57삭제: "sha256": "6fce2f154d57e28e975582755ca13d9ebb4d2d6927a53c42f03e8a9b5f78f78c"
56추가: "sha256": "2b47293130e0653e22b4b40f821e58aa2e0dc2441e56b2278679664060e5b0e9"
5857 },
5958 {
6059 "path": "tests/rust-app-real-worker/Cargo.toml",
@@ -62,7 +61,7 @@
6261 },
6362 {
6463 "path": "tests/rust-app-real-worker/README.md",
65삭제: "sha256": "7902bca8e72fc9599492bfe022b123a60b1ae6cad6fbbd8094bb3c5512268a98"
64추가: "sha256": "3273a5530087fd9f8b6021eaeec6e9e30ca91b77b1b18aceb5673612f1f6a9bf"
6665 },
6766 {
6867 "path": "tests/rust-app-real-worker/fixtures/sample.tar.gz",
@@ -74,7 +73,7 @@
7473 },
7574 {
7675 "path": "tests/rust-app-real-worker/flows.rs",
77삭제: "sha256": "d2510f60db64cc373a8affd4b7102d16e3733f82e224905e18b7c5633134e8ff"
76추가: "sha256": "06bffea50c485edfb10a2dfa9158d02159da11efbdf4a5183f76ced96f86a9c1"
7877 },
7978 {
8079 "path": "tests/rust-app-real-worker/generate.py",
@@ -99,6 +98,10 @@
9998 {
10099 "path": "tests/rust-app-ui/regressions.rs",
101100 "sha256": "a4c3685a380cb73fd506a290270b2a5308529ef4f843c203127c2bc9a2df2a80"
101추가: },
102추가: {
103추가: "path": "tests/rust-app-real-worker/password_flows.rs",
104추가: "sha256": "0faca27cc8952df4026d544c503a166bde4c0676af3716f70a748aa44c7b7ce1"
102105 }
103106 ],
104107 "review_regressions": [
@@ -113,8 +116,9 @@
113116 ],
114117 "before_review_fix": "Earlier PR62 fixes reproduced 3 failures before repair. Integration tests additionally reproduced normal channel shutdown and late-cancel races before repair. PR68 review race reproduced with the new test before repair; all 100 iterations passed after repair.",
115118 "approved_ui_head": "423a7c80c9d7182e07d29adee03a97d09a19b11f",
116삭제: "tested_local_head": "b7e558cd8afbb8bb54b55ebd4c463641cc2129e5",
117삭제: "real_worker_tests_passed": 10,
118삭제: "runner_tests_passed": 17,
119삭제: "merge_validation": "Approved UI logic unchanged from 2174031; main malicious fixtures integrated and full local runner passed."
119추가: "tested_local_head": "7bf3d4107005a36c1e8ed0619b6d09343b27f494",
120추가: "real_worker_tests_passed": 17,
121추가: "runner_tests_passed": 23,
122추가: "password_screen_tests_passed": 7,
123추가: "password_flow": "Actual widget input and real worker validated ZipCrypto, AES-256 AE-1/AE-2 Store/Deflate extraction, retry, three failures, cancel, UTF-8 byte limits and cold-start AES ZIP creation/reopen/extraction."
120124}