Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions crates/xls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ workspace = true
[dependencies]
craft-cfb = { workspace = true }
craft-sheet = { workspace = true }
# RC4 and RC4 CryptoAPI encryption ([MS-OFFCRYPTO] 2.3.5, 2.3.6).
md5 = { workspace = true }
sha1 = { version = "0.10", default-features = false }
# zlib-wrapped metafiles in the drawing group.
miniz_oxide = "0.9"
thiserror = { workspace = true }
Expand Down
19 changes: 15 additions & 4 deletions crates/xls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
A clean-room reader for Excel 97-2003 workbooks (`.xls`, BIFF8). It turns the bytes of a file
into a `Workbook` that keeps the file's own terms: cells, formulas as text, the format table,
column and row records. Mapping that onto an application's document is the caller's work.
No `unsafe`; the only dependencies are `craft-cfb` (the compound file container), `craft-sheet` (cell
positions, values and tables shared with the other spreadsheet formats) and `thiserror`.
No `unsafe`. Dependencies: `craft-cfb` (the compound file container), `craft-sheet` (cell positions,
values and tables shared with the other spreadsheet formats), `md-5` and `sha1` (RC4 keys),
`miniz_oxide` (compressed metafiles) and `thiserror`.
No third-party implementation was consulted.

| Document | Used for |
Expand Down Expand Up @@ -50,8 +51,18 @@ conditional formats per sheet. A damaged comment, object or conditional-format r
skipped with a warning.

Not read: charts, other shapes, newer conditional formats (CF12), hyperlinks,
PivotTables, macros. Each is named once in `Read::warnings`. Encrypted workbooks
(`Error::Encrypted`) and BIFF5 and older (`Error::Biff5`) are refused. There is no writer
PivotTables, macros. Each is named once in `Read::warnings`. BIFF5 and older is refused
(`Error::Biff5`).

## Encrypted workbooks

A workbook encrypted with RC4 (version 1.1, keyed through MD5) or RC4 CryptoAPI (versions 2.2,
3.2 and 4.2, keyed through SHA-1 with a 40- to 128-bit key, which current Excel writes) is read
with `read_with_password` ([MS-OFFCRYPTO] 2.3.5, 2.3.6). Without a password, Excel's default one
(`VelvetSweatshop`) is tried, and `Error::Encrypted` says a password is needed. A wrong password
is `Error::WrongPassword`; XOR obfuscation and CryptoAPI with AES, another cipher or hash, or an
external provider are `Error::UnsupportedEncryption`. Every size in the FilePass record is
checked before it is used. There is no writer
(`craft_xls::testing` builds small fixtures for tests).

A formula that cannot be put back into text (a link to another workbook, a macro command, an
Expand Down
Loading
Loading