From ce55340a3e39798adb02f322eeb21449538f2931 Mon Sep 17 00:00:00 2001 From: Aliaksandr Rahalevich Date: Mon, 18 Dec 2023 15:14:06 -0800 Subject: [PATCH] Detect password protected xls files --- src/xls.rs | 3 ++- tests/issue_385.xls | Bin 0 -> 25600 bytes tests/test.rs | 13 +++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/issue_385.xls diff --git a/src/xls.rs b/src/xls.rs index b925e014..7c40ef00 100644 --- a/src/xls.rs +++ b/src/xls.rs @@ -280,7 +280,8 @@ impl Xls { for record in records { let mut r = record?; match r.typ { - 0x0012 if read_u16(r.data) != 0 => return Err(XlsError::Password), + // 2.4.117 FilePass + 0x002F if read_u16(r.data) != 0 => return Err(XlsError::Password), // CodePage 0x0042 => { if self.options.force_codepage.is_none() { diff --git a/tests/issue_385.xls b/tests/issue_385.xls new file mode 100644 index 0000000000000000000000000000000000000000..5b5d3a7d351dabfd4855fbdf4e37dacc41f4e821 GIT binary patch literal 25600 zcmeIbWmFwev?h4b;O_1Y0TSFjcyIzFxVuAecPF?64estP!GgO62=1f+%PTwx_P^sH!1JvC`5g@e zUjF(DeErYqTkt%X`q%zHlmU1+@P>qi0ck0Yz3B!)f?(l5ptm4S5X9flh1d47vHVa3 zF_jX1;z(Wpj?~Y^Ka-db)VS5>h4UKt^U9bs=+_R1oSK~-4pFeWI*C36B)=6ZC)rTX}g zJl5Dk8D(cy&r)%+rTzJdj+dtbybdIwU*x$1saqFI8TT85pYW$A$U|)^@}u1|<1T)A zzgz(pCm`m#=r=D&dn>8^8G8NWhrHw)HW*HjRS+G+SAQ)O@@p<$YVf8Ewp=-{vi4y~ z-TUQ2VsE}6P#Iz38MA>HK(bG$Q%Rr8_GY|KHW*o)#&!dbBYlx@;h+$My`aeH;nfofggt;+z)vxn*~Byv!}0PJVgX7PJa}h;r`yX(@?Pw;OxC|alT+H zE!Z6|YQy>+rkV#>L=@bhjWBH+)p7I1$8)vPDv%}RJZU^TUMuhTK)C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m|I97bSi`qJ}^Z zp6~e*h^}}+xR?W?03n^7K|0%X?aGgsP1FkoMs+Mk#%&rAU9x*N6zUaYB1Qbj0AF!@ z_m$->L2g_T6(On%<7=Ry*N3s!83>n;u1AlwYwB!`lfE^U3CU{UQP>rNz?Yq>T5FZr zeh5-vUX~1oF$jWhe2A&GL;uYGLT^x#xp=t{Ri~5`0nY1-bt%f)OCu8Wv?7_HLC<$$ z5Gv?+^Bp%1V!_a54gUHM;wbyqY`|9d*Zxn* zzzg^deq>niYtsKy1DK7V?2CIvGqln;I1nRk?IJ6f8wKMH7{GF2FrdNs00tZwW?+Dy zV*rJMfdobw7|38Wfq@A|9~h8epwWWB@1BA{cwi{&o9SB_yOf0DO z{MVKff&Jyp4IOM9ZB3lWUk3hV;9my*W#C^1{{NYQ|5g1DIXgC+ z!9s|ZkPNQ>neHoq`X8v_;lTjv=Z|2Zf}sfpE*M5&Ac6tZ-e_PrfdSP0o?zgB5eNow zJs=VcBrvkU`0uX=K!d*n4XDq72tX{L{Xb1fz#_mnfa?(|X2!Uk3hV;9my*W#C^1{$=3*zzhHt zF;FlAH8)Uy!+-$`22fK2_w<2UA9x}JD5im$9jMJA`Fkip+^SpFydU!H>hmj8d#2gdPVb;RNS4@(%33dk8` z4gTo=U3Y147EJz*31FN+=HPjo|3y$bus(1M0msjORi6}y2OK=$1_KfYD;WMAgYn-j T@c(W+-2WTv4}SdSzv=&9c$`Km literal 0 HcmV?d00001 diff --git a/tests/test.rs b/tests/test.rs index 41453f37..b1803a9d 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1514,3 +1514,16 @@ fn issue_374() { assert_eq!("sheetjs", cell_text); } + +#[test] +fn issue_385() { + let path = format!("{}/tests/issue_385.xls", env!("CARGO_MANIFEST_DIR")); + + assert!( + matches!( + open_workbook::, std::string::String>(path), + Err(calamine::XlsError::Password) + ), + "Is expeced to return XlsError::Password error" + ); +}