ooxml-core 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PptxHandler-5YP75BPO.cjs +12 -0
- package/dist/PptxHandler-GT5Q66TG.mjs +3 -0
- package/dist/{PptxHandler-FIN6XDTI.mjs → PptxHandler-KNBFECUE.mjs} +3 -3
- package/dist/PresentationBuilder-5DCCFHWJ.mjs +7 -0
- package/dist/PresentationBuilder-CVM6LJ7L.mjs +3 -0
- package/dist/PresentationBuilder-II7C4A3R.cjs +20 -0
- package/dist/automation/docx.d.ts +18 -0
- package/dist/automation/docx.d.ts.map +1 -1
- package/dist/automation/index.cjs +21278 -8022
- package/dist/automation/index.d.ts +1 -0
- package/dist/automation/index.d.ts.map +1 -1
- package/dist/automation/index.mjs +21275 -8023
- package/dist/automation/node.cjs +66 -6
- package/dist/automation/node.d.ts +10 -0
- package/dist/automation/node.d.ts.map +1 -1
- package/dist/automation/node.mjs +67 -7
- package/dist/automation/outline.d.ts +29 -0
- package/dist/automation/outline.d.ts.map +1 -0
- package/dist/automation/xlsx.d.ts +21 -0
- package/dist/automation/xlsx.d.ts.map +1 -1
- package/dist/chart/auto-title.d.ts +31 -0
- package/dist/chart/auto-title.d.ts.map +1 -0
- package/dist/chart/axis-format.d.ts +13 -0
- package/dist/chart/axis-format.d.ts.map +1 -0
- package/dist/chart/bubble-radius.d.ts +30 -0
- package/dist/chart/bubble-radius.d.ts.map +1 -0
- package/dist/chart/error-bar-amount.d.ts +22 -0
- package/dist/chart/error-bar-amount.d.ts.map +1 -0
- package/dist/chart/hierarchy.d.ts +69 -0
- package/dist/chart/hierarchy.d.ts.map +1 -0
- package/dist/chart/index.cjs +2377 -527
- package/dist/chart/index.d.ts +12 -0
- package/dist/chart/index.d.ts.map +1 -1
- package/dist/chart/index.mjs +2338 -528
- package/dist/chart/model-analysis.d.ts +66 -0
- package/dist/chart/model-analysis.d.ts.map +1 -0
- package/dist/chart/model-series.d.ts +5 -0
- package/dist/chart/model-series.d.ts.map +1 -1
- package/dist/chart/number-format-pattern.d.ts +35 -0
- package/dist/chart/number-format-pattern.d.ts.map +1 -0
- package/dist/chart/number-format.d.ts +21 -0
- package/dist/chart/number-format.d.ts.map +1 -0
- package/dist/chart/parse-analysis.d.ts +13 -0
- package/dist/chart/parse-analysis.d.ts.map +1 -0
- package/dist/chart/parse-series.d.ts +1 -1
- package/dist/chart/parse-series.d.ts.map +1 -1
- package/dist/chart/parse-util.d.ts +2 -0
- package/dist/chart/parse-util.d.ts.map +1 -1
- package/dist/chart/render/chart-svg-analysis.d.ts +7 -0
- package/dist/chart/render/chart-svg-analysis.d.ts.map +1 -0
- package/dist/chart/render/chart-svg-bars.d.ts +5 -0
- package/dist/chart/render/chart-svg-bars.d.ts.map +1 -1
- package/dist/chart/render/chart-svg-cartesian.d.ts +7 -2
- package/dist/chart/render/chart-svg-cartesian.d.ts.map +1 -1
- package/dist/chart/render/chart-svg-hierarchy.d.ts +5 -0
- package/dist/chart/render/chart-svg-hierarchy.d.ts.map +1 -0
- package/dist/chart/render/chart-svg-plots.d.ts +5 -0
- package/dist/chart/render/chart-svg-plots.d.ts.map +1 -0
- package/dist/chart/render/chart-svg-stock.d.ts +4 -0
- package/dist/chart/render/chart-svg-stock.d.ts.map +1 -0
- package/dist/chart/render/chart-svg-waterfall.d.ts +4 -0
- package/dist/chart/render/chart-svg-waterfall.d.ts.map +1 -0
- package/dist/chart/render/chart-svg-xy.d.ts +4 -0
- package/dist/chart/render/chart-svg-xy.d.ts.map +1 -0
- package/dist/chart/render/chart-svg.d.ts +1 -1
- package/dist/chart/render/chart-svg.d.ts.map +1 -1
- package/dist/chart/render/chart-value-axis.d.ts +6 -1
- package/dist/chart/render/chart-value-axis.d.ts.map +1 -1
- package/dist/chart/render/chart-view-analysis.d.ts +30 -0
- package/dist/chart/render/chart-view-analysis.d.ts.map +1 -0
- package/dist/chart/render/chart-view-ex.d.ts +24 -0
- package/dist/chart/render/chart-view-ex.d.ts.map +1 -0
- package/dist/chart/render/chart-view-families.d.ts +10 -0
- package/dist/chart/render/chart-view-families.d.ts.map +1 -0
- package/dist/chart/render/chart-view-series.d.ts +36 -0
- package/dist/chart/render/chart-view-series.d.ts.map +1 -0
- package/dist/chart/render/chart-view-stock.d.ts +23 -0
- package/dist/chart/render/chart-view-stock.d.ts.map +1 -0
- package/dist/chart/render/chart-view.d.ts +49 -18
- package/dist/chart/render/chart-view.d.ts.map +1 -1
- package/dist/chart/render/index.d.ts +2 -0
- package/dist/chart/render/index.d.ts.map +1 -1
- package/dist/chart/render/render-space.d.ts +6 -1
- package/dist/chart/render/render-space.d.ts.map +1 -1
- package/dist/chart/render/summary-analysis.d.ts +11 -0
- package/dist/chart/render/summary-analysis.d.ts.map +1 -0
- package/dist/chart/render/summary-from-chartex.d.ts +11 -0
- package/dist/chart/render/summary-from-chartex.d.ts.map +1 -0
- package/dist/chart/render/summary-from-space.d.ts.map +1 -1
- package/dist/chart/render/summary.d.ts +86 -3
- package/dist/chart/render/summary.d.ts.map +1 -1
- package/dist/chart/stock-candles.d.ts +72 -0
- package/dist/chart/stock-candles.d.ts.map +1 -0
- package/dist/chart/style-palette.d.ts +29 -0
- package/dist/chart/style-palette.d.ts.map +1 -0
- package/dist/chart/sunburst-arcs.d.ts +41 -0
- package/dist/chart/sunburst-arcs.d.ts.map +1 -0
- package/dist/chart/trendline-fit.d.ts +39 -0
- package/dist/chart/trendline-fit.d.ts.map +1 -0
- package/dist/chart/waterfall.d.ts +31 -0
- package/dist/chart/waterfall.d.ts.map +1 -0
- package/dist/chart/write-analysis.d.ts +12 -0
- package/dist/chart/write-analysis.d.ts.map +1 -0
- package/dist/chart/write-series.d.ts.map +1 -1
- package/dist/{chunk-G5PQKHCG.mjs → chunk-2D4IFQ5M.mjs} +1 -1
- package/dist/{chunk-UAY26XOI.mjs → chunk-2EBMHIGJ.mjs} +1303 -994
- package/dist/{chunk-TVE6UIJF.mjs → chunk-4WZLFUUA.mjs} +54 -13
- package/dist/{chunk-H2FRDUNV.mjs → chunk-54ASP65T.mjs} +868 -585
- package/dist/chunk-M4XLF4R7.mjs +387 -0
- package/dist/{chunk-O6NIA4NG.mjs → chunk-ORH32TO3.mjs} +5798 -5742
- package/dist/{chunk-B2JBBAEQ.mjs → chunk-TNNXOW2O.mjs} +1 -1
- package/dist/{chunk-IT3U6QD6.cjs → chunk-TQE7FFNT.cjs} +6754 -6695
- package/dist/{chunk-7QZGRB3T.cjs → chunk-X7MGZQ6C.cjs} +1321 -995
- package/dist/{chunk-6DELVMYB.mjs → chunk-XGXIS4PN.mjs} +12316 -12260
- package/dist/crypto/decrypt.d.ts +17 -3
- package/dist/crypto/decrypt.d.ts.map +1 -1
- package/dist/crypto/encryption-info.d.ts.map +1 -1
- package/dist/crypto/index.cjs +252 -78
- package/dist/crypto/index.d.ts +19 -4
- package/dist/crypto/index.d.ts.map +1 -1
- package/dist/crypto/index.mjs +252 -79
- package/dist/crypto/key-derivation.d.ts +2 -3
- package/dist/crypto/key-derivation.d.ts.map +1 -1
- package/dist/crypto/validate.d.ts +22 -0
- package/dist/crypto/validate.d.ts.map +1 -0
- package/dist/diagram/engine/layout-def-parse.d.ts.map +1 -1
- package/dist/diagram/engine/pres-tree.d.ts.map +1 -1
- package/dist/diagram/index.cjs +102 -52
- package/dist/diagram/index.mjs +102 -52
- package/dist/digest/index.cjs +23 -11
- package/dist/digest/index.d.ts +2 -1
- package/dist/digest/index.d.ts.map +1 -1
- package/dist/digest/index.mjs +21 -12
- package/dist/digest/password-hash.d.ts +19 -5
- package/dist/digest/password-hash.d.ts.map +1 -1
- package/dist/digest/timing-safe.d.ts +7 -0
- package/dist/digest/timing-safe.d.ts.map +1 -0
- package/dist/docx/block-parser.d.ts.map +1 -1
- package/dist/docx/chart-paint.d.ts.map +1 -1
- package/dist/docx/chart.d.ts +10 -2
- package/dist/docx/chart.d.ts.map +1 -1
- package/dist/docx/content-control-edit.d.ts +26 -0
- package/dist/docx/content-control-edit.d.ts.map +1 -0
- package/dist/docx/content-control-model.d.ts +51 -0
- package/dist/docx/content-control-model.d.ts.map +1 -0
- package/dist/docx/content-control.d.ts +9 -0
- package/dist/docx/content-control.d.ts.map +1 -0
- package/dist/docx/default-styles.d.ts.map +1 -1
- package/dist/docx/drawing.d.ts.map +1 -1
- package/dist/docx/embedded.cjs +9932 -935
- package/dist/docx/embedded.mjs +9932 -935
- package/dist/docx/equation.d.ts +7 -3
- package/dist/docx/equation.d.ts.map +1 -1
- package/dist/docx/index.cjs +14117 -1513
- package/dist/docx/index.d.ts +6 -0
- package/dist/docx/index.d.ts.map +1 -1
- package/dist/docx/index.mjs +14093 -1514
- package/dist/docx/inline-model.d.ts +3 -0
- package/dist/docx/inline-model.d.ts.map +1 -1
- package/dist/docx/layout/adapt-floats.d.ts +3 -3
- package/dist/docx/layout/adapt-floats.d.ts.map +1 -1
- package/dist/docx/layout/adapter.d.ts.map +1 -1
- package/dist/docx/layout/equation-object.d.ts +7 -0
- package/dist/docx/layout/equation-object.d.ts.map +1 -0
- package/dist/docx/layout/floats.d.ts +8 -0
- package/dist/docx/layout/floats.d.ts.map +1 -1
- package/dist/docx/layout/incremental-layout.d.ts +39 -0
- package/dist/docx/layout/incremental-layout.d.ts.map +1 -0
- package/dist/docx/layout/index.cjs +14177 -1707
- package/dist/docx/layout/index.d.ts +2 -2
- package/dist/docx/layout/index.d.ts.map +1 -1
- package/dist/docx/layout/index.mjs +14176 -1708
- package/dist/docx/layout/input.d.ts +4 -0
- package/dist/docx/layout/input.d.ts.map +1 -1
- package/dist/docx/layout/layout-session.d.ts +13 -2
- package/dist/docx/layout/layout-session.d.ts.map +1 -1
- package/dist/docx/layout/layout.d.ts +1 -1
- package/dist/docx/layout/layout.d.ts.map +1 -1
- package/dist/docx/layout/line-metrics.d.ts.map +1 -1
- package/dist/docx/layout/page-cursor.d.ts +1 -1
- package/dist/docx/layout/page-cursor.d.ts.map +1 -1
- package/dist/docx/layout/page-fields.d.ts +3 -1
- package/dist/docx/layout/page-fields.d.ts.map +1 -1
- package/dist/docx/layout/result.d.ts +14 -1
- package/dist/docx/layout/result.d.ts.map +1 -1
- package/dist/docx/layout/section-flow.d.ts +11 -1
- package/dist/docx/layout/section-flow.d.ts.map +1 -1
- package/dist/docx/ligatures.d.ts +2 -0
- package/dist/docx/ligatures.d.ts.map +1 -1
- package/dist/docx/load/index.cjs +12709 -3590
- package/dist/docx/load/index.mjs +12709 -3590
- package/dist/docx/model-paragraph.d.ts +3 -0
- package/dist/docx/model-paragraph.d.ts.map +1 -1
- package/dist/docx/model-run.d.ts +3 -0
- package/dist/docx/model-run.d.ts.map +1 -1
- package/dist/docx/model.d.ts +3 -0
- package/dist/docx/model.d.ts.map +1 -1
- package/dist/docx/numbering-parse.d.ts.map +1 -1
- package/dist/docx/numbering-text.d.ts.map +1 -1
- package/dist/docx/package-limits.d.ts +6 -0
- package/dist/docx/package-limits.d.ts.map +1 -0
- package/dist/docx/parse-content-control.d.ts +28 -0
- package/dist/docx/parse-content-control.d.ts.map +1 -0
- package/dist/docx/parse-table.d.ts.map +1 -1
- package/dist/docx/parse.d.ts.map +1 -1
- package/dist/docx/save.d.ts.map +1 -1
- package/dist/docx/shape-model.d.ts +31 -0
- package/dist/docx/shape-model.d.ts.map +1 -0
- package/dist/docx/shape-palette.d.ts +19 -0
- package/dist/docx/shape-palette.d.ts.map +1 -0
- package/dist/docx/shape-parse.d.ts +16 -0
- package/dist/docx/shape-parse.d.ts.map +1 -0
- package/dist/docx/shape-svg.d.ts +20 -0
- package/dist/docx/shape-svg.d.ts.map +1 -0
- package/dist/docx/table-model.d.ts +4 -0
- package/dist/docx/table-model.d.ts.map +1 -1
- package/dist/docx/ui/content-control-commands.d.ts +37 -0
- package/dist/docx/ui/content-control-commands.d.ts.map +1 -0
- package/dist/docx/ui/content-control-guard.d.ts +8 -0
- package/dist/docx/ui/content-control-guard.d.ts.map +1 -0
- package/dist/docx/ui/content-control-spans.d.ts +19 -0
- package/dist/docx/ui/content-control-spans.d.ts.map +1 -0
- package/dist/docx/ui/index.cjs +3132 -506
- package/dist/docx/ui/index.d.ts +3 -0
- package/dist/docx/ui/index.d.ts.map +1 -1
- package/dist/docx/ui/index.mjs +3117 -507
- package/dist/docx/ui/inline-content-schema.d.ts.map +1 -1
- package/dist/docx/ui/paragraph-attributes.d.ts.map +1 -1
- package/dist/docx/ui/ribbon-action-ids.d.ts +1 -1
- package/dist/docx/ui/ribbon-action-ids.d.ts.map +1 -1
- package/dist/docx/ui/run-adapter.d.ts.map +1 -1
- package/dist/docx/ui/run-compare.d.ts.map +1 -1
- package/dist/docx/ui/run-mark-properties.d.ts.map +1 -1
- package/dist/docx/ui/run-marks.d.ts.map +1 -1
- package/dist/docx/ui/schema-marks.d.ts +16 -1
- package/dist/docx/ui/schema-marks.d.ts.map +1 -1
- package/dist/docx/ui/table-structure-guard.d.ts.map +1 -1
- package/dist/docx/write-block-placement.d.ts +9 -0
- package/dist/docx/write-block-placement.d.ts.map +1 -0
- package/dist/docx/write-content-control.d.ts +12 -0
- package/dist/docx/write-content-control.d.ts.map +1 -0
- package/dist/docx/write-drawing.d.ts +2 -0
- package/dist/docx/write-drawing.d.ts.map +1 -1
- package/dist/docx/write-inline.d.ts.map +1 -1
- package/dist/docx/write-paragraph.d.ts.map +1 -1
- package/dist/docx/write-shape.d.ts +16 -0
- package/dist/docx/write-shape.d.ts.map +1 -0
- package/dist/docx/write-table.d.ts.map +1 -1
- package/dist/docx/write.d.ts.map +1 -1
- package/dist/drawingml/index.cjs +24 -0
- package/dist/drawingml/index.mjs +24 -0
- package/dist/geometry/index.cjs +63 -48
- package/dist/geometry/index.mjs +63 -48
- package/dist/geometry/preset-shape-definitions-table.d.ts.map +1 -1
- package/dist/index.cjs +4291 -1578
- package/dist/index.mjs +4291 -1578
- package/dist/math/equation-gallery.d.ts +10 -0
- package/dist/math/equation-gallery.d.ts.map +1 -0
- package/dist/math/index.cjs +777 -139
- package/dist/math/index.d.ts +3 -0
- package/dist/math/index.d.ts.map +1 -1
- package/dist/math/index.mjs +772 -140
- package/dist/math/latex-omml-siblings.d.ts.map +1 -1
- package/dist/math/latex-to-omml.d.ts.map +1 -1
- package/dist/math/omml-box-grouped.d.ts +9 -0
- package/dist/math/omml-box-grouped.d.ts.map +1 -0
- package/dist/math/omml-box-layout.d.ts +15 -0
- package/dist/math/omml-box-layout.d.ts.map +1 -0
- package/dist/math/omml-box-structures.d.ts +7 -0
- package/dist/math/omml-box-structures.d.ts.map +1 -0
- package/dist/math/omml-box.d.ts +85 -0
- package/dist/math/omml-box.d.ts.map +1 -0
- package/dist/math/omml-dom.d.ts.map +1 -1
- package/dist/math/omml-mathml-converters.d.ts.map +1 -1
- package/dist/math/omml-svg.d.ts +14 -0
- package/dist/math/omml-svg.d.ts.map +1 -0
- package/dist/math/omml-to-xml.d.ts +10 -0
- package/dist/math/omml-to-xml.d.ts.map +1 -0
- package/dist/opc/embedded-packages.d.ts.map +1 -1
- package/dist/opc/index.cjs +257 -22
- package/dist/opc/index.d.ts +1 -0
- package/dist/opc/index.d.ts.map +1 -1
- package/dist/opc/index.mjs +251 -23
- package/dist/opc/package.d.ts.map +1 -1
- package/dist/opc/signature/detection.d.ts +22 -6
- package/dist/opc/signature/detection.d.ts.map +1 -1
- package/dist/opc/signature/index.d.ts +1 -1
- package/dist/opc/signature/index.d.ts.map +1 -1
- package/dist/opc/signature/xml-utils.d.ts.map +1 -1
- package/dist/opc/zip-limits.d.ts +52 -0
- package/dist/opc/zip-limits.d.ts.map +1 -0
- package/dist/pptx/automation/index.cjs +1848 -1320
- package/dist/pptx/automation/index.d.ts +4 -4
- package/dist/pptx/automation/index.mjs +6 -6
- package/dist/pptx/chunks/{elements-DmbzOhFu.d.ts → elements-tK7xnWeS.d.ts} +20 -9
- package/dist/pptx/chunks/elements-tK7xnWeS.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-Cija6Dih.d.ts → index-BSpNQuvz.d.ts} +30 -5
- package/dist/pptx/chunks/{index-Cija6Dih.d.ts.map → index-BSpNQuvz.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-BmvOxbsh.d.ts → index-DS9Y4Ne3.d.ts} +25 -9
- package/dist/pptx/chunks/index-DS9Y4Ne3.d.ts.map +1 -0
- package/dist/pptx/chunks/inspection-status-DjiWd_Aa.d.ts.map +1 -1
- package/dist/pptx/chunks/{text-operations-sXxhsKDd.d.ts → text-operations-BdD_UQ11.d.ts} +2 -2
- package/dist/pptx/chunks/{text-operations-sXxhsKDd.d.ts.map → text-operations-BdD_UQ11.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +1795 -1275
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +5 -5
- package/dist/pptx/converter/index.cjs +80 -54
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +3 -3
- package/dist/pptx/editor/render/find-replace.cjs +14 -14
- package/dist/pptx/editor/render/find-replace.d.ts +2 -2
- package/dist/pptx/editor/render/find-replace.mjs +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +8 -8
- package/dist/pptx/editor/render/slide-operations.mjs +2 -2
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
- package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
- package/dist/pptx/index.cjs +1117 -351
- package/dist/pptx/index.d.ts +5 -5
- package/dist/pptx/index.mjs +6 -6
- package/dist/pptx/signature-node/index.cjs +342 -65
- package/dist/pptx/signature-node/index.d.ts +12 -1
- package/dist/pptx/signature-node/index.d.ts.map +1 -1
- package/dist/pptx/signature-node/index.mjs +112 -52
- package/dist/teams/activity-feed.d.ts +19 -0
- package/dist/teams/activity-feed.d.ts.map +1 -0
- package/dist/teams/activity-state.d.ts +12 -0
- package/dist/teams/activity-state.d.ts.map +1 -0
- package/dist/teams/activity.d.ts +52 -0
- package/dist/teams/activity.d.ts.map +1 -0
- package/dist/teams/calendar.d.ts +57 -0
- package/dist/teams/calendar.d.ts.map +1 -0
- package/dist/teams/chat-actions.d.ts +20 -0
- package/dist/teams/chat-actions.d.ts.map +1 -0
- package/dist/teams/chat-rooms.d.ts +42 -0
- package/dist/teams/chat-rooms.d.ts.map +1 -0
- package/dist/teams/chat-view.d.ts +56 -0
- package/dist/teams/chat-view.d.ts.map +1 -0
- package/dist/teams/chat.d.ts +19 -3
- package/dist/teams/chat.d.ts.map +1 -1
- package/dist/teams/chats.d.ts +52 -0
- package/dist/teams/chats.d.ts.map +1 -0
- package/dist/teams/ics-timezone.d.ts +17 -0
- package/dist/teams/ics-timezone.d.ts.map +1 -0
- package/dist/teams/ics.d.ts +20 -0
- package/dist/teams/ics.d.ts.map +1 -0
- package/dist/teams/index.cjs +7252 -2926
- package/dist/teams/index.d.ts +22 -0
- package/dist/teams/index.d.ts.map +1 -1
- package/dist/teams/index.mjs +7162 -2927
- package/dist/teams/meeting-actions.d.ts +31 -0
- package/dist/teams/meeting-actions.d.ts.map +1 -0
- package/dist/teams/meeting-exceptions.d.ts +28 -0
- package/dist/teams/meeting-exceptions.d.ts.map +1 -0
- package/dist/teams/meeting-reminders.d.ts +13 -0
- package/dist/teams/meeting-reminders.d.ts.map +1 -0
- package/dist/teams/meetings.d.ts +71 -0
- package/dist/teams/meetings.d.ts.map +1 -0
- package/dist/teams/mention-text.d.ts +11 -0
- package/dist/teams/mention-text.d.ts.map +1 -0
- package/dist/teams/mentions.d.ts +68 -0
- package/dist/teams/mentions.d.ts.map +1 -0
- package/dist/teams/model.d.ts +7 -0
- package/dist/teams/model.d.ts.map +1 -1
- package/dist/teams/notifications.d.ts +21 -0
- package/dist/teams/notifications.d.ts.map +1 -0
- package/dist/teams/recurrence.d.ts +18 -0
- package/dist/teams/recurrence.d.ts.map +1 -0
- package/dist/teams/roster.d.ts +12 -0
- package/dist/teams/roster.d.ts.map +1 -0
- package/dist/teams/server-config.d.ts +23 -2
- package/dist/teams/server-config.d.ts.map +1 -1
- package/dist/teams/server-session.d.ts +19 -0
- package/dist/teams/server-session.d.ts.map +1 -0
- package/dist/teams/shared-chat.d.ts +83 -0
- package/dist/teams/shared-chat.d.ts.map +1 -0
- package/dist/teams/store.d.ts +58 -4
- package/dist/teams/store.d.ts.map +1 -1
- package/dist/teams/sync-transport.d.ts +12 -0
- package/dist/teams/sync-transport.d.ts.map +1 -0
- package/dist/teams/time-zone.d.ts +32 -0
- package/dist/teams/time-zone.d.ts.map +1 -0
- package/dist/teams/view.d.ts +3 -0
- package/dist/teams/view.d.ts.map +1 -1
- package/dist/teams/workspace.d.ts +13 -2
- package/dist/teams/workspace.d.ts.map +1 -1
- package/dist/visio/edit-connector-follow.d.ts +15 -0
- package/dist/visio/edit-connector-follow.d.ts.map +1 -0
- package/dist/visio/edit-connector-obstacles.d.ts +9 -3
- package/dist/visio/edit-connector-obstacles.d.ts.map +1 -1
- package/dist/visio/edit-connector-reroute.d.ts.map +1 -1
- package/dist/visio/edit-connector.d.ts.map +1 -1
- package/dist/visio/edit-master-add.d.ts +37 -0
- package/dist/visio/edit-master-add.d.ts.map +1 -0
- package/dist/visio/edit-master-drop.d.ts +6 -0
- package/dist/visio/edit-master-drop.d.ts.map +1 -1
- package/dist/visio/edit-recalculate-index.d.ts +5 -0
- package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
- package/dist/visio/edit-recalculate-values.d.ts.map +1 -1
- package/dist/visio/edit-stencil-connector-layout.d.ts +2 -0
- package/dist/visio/edit-stencil-connector-layout.d.ts.map +1 -1
- package/dist/visio/edit-stencil-connector.d.ts +1 -0
- package/dist/visio/edit-stencil-connector.d.ts.map +1 -1
- package/dist/visio/edit-stencil-import.d.ts +10 -0
- package/dist/visio/edit-stencil-import.d.ts.map +1 -0
- package/dist/visio/edit-stencil-line.d.ts +29 -0
- package/dist/visio/edit-stencil-line.d.ts.map +1 -0
- package/dist/visio/edit-stencil-master.d.ts +3 -8
- package/dist/visio/edit-stencil-master.d.ts.map +1 -1
- package/dist/visio/edit.d.ts.map +1 -1
- package/dist/visio/formula-evaluate.d.ts.map +1 -1
- package/dist/visio/formula-math-functions.d.ts +11 -0
- package/dist/visio/formula-math-functions.d.ts.map +1 -0
- package/dist/visio/formula-text-functions.d.ts +23 -0
- package/dist/visio/formula-text-functions.d.ts.map +1 -0
- package/dist/visio/formula.d.ts.map +1 -1
- package/dist/visio/index.cjs +2552 -1833
- package/dist/visio/index.d.ts +1 -0
- package/dist/visio/index.d.ts.map +1 -1
- package/dist/visio/index.mjs +2552 -1834
- package/dist/visio/parser.d.ts +6 -0
- package/dist/visio/parser.d.ts.map +1 -1
- package/dist/visio/stencil-file.d.ts +14 -0
- package/dist/visio/stencil-file.d.ts.map +1 -0
- package/dist/visio/ui/index.cjs +2398 -1679
- package/dist/visio/ui/index.mjs +2398 -1680
- package/dist/visio/ui/master-drop.d.ts +10 -0
- package/dist/visio/ui/master-drop.d.ts.map +1 -1
- package/dist/xlsx/edit/cell-values.d.ts.map +1 -1
- package/dist/xlsx/edit/clipboard-html-parse.d.ts +4 -0
- package/dist/xlsx/edit/clipboard-html-parse.d.ts.map +1 -1
- package/dist/xlsx/edit/data-table.d.ts +38 -0
- package/dist/xlsx/edit/data-table.d.ts.map +1 -0
- package/dist/xlsx/edit/drawings.d.ts.map +1 -1
- package/dist/xlsx/edit/goal-seek.d.ts +30 -0
- package/dist/xlsx/edit/goal-seek.d.ts.map +1 -0
- package/dist/xlsx/edit/goal-solver.d.ts +20 -0
- package/dist/xlsx/edit/goal-solver.d.ts.map +1 -0
- package/dist/xlsx/edit/history.d.ts +1 -1
- package/dist/xlsx/edit/history.d.ts.map +1 -1
- package/dist/xlsx/edit/index.d.ts +5 -0
- package/dist/xlsx/edit/index.d.ts.map +1 -1
- package/dist/xlsx/edit/input-text.d.ts.map +1 -1
- package/dist/xlsx/edit/pivots.d.ts +2 -1
- package/dist/xlsx/edit/pivots.d.ts.map +1 -1
- package/dist/xlsx/edit/scenarios.d.ts +41 -0
- package/dist/xlsx/edit/scenarios.d.ts.map +1 -0
- package/dist/xlsx/edit/session.d.ts.map +1 -1
- package/dist/xlsx/edit/slicers.d.ts +34 -0
- package/dist/xlsx/edit/slicers.d.ts.map +1 -0
- package/dist/xlsx/edit/table-edits.d.ts.map +1 -1
- package/dist/xlsx/edit/timelines.d.ts +26 -0
- package/dist/xlsx/edit/timelines.d.ts.map +1 -0
- package/dist/xlsx/edit/types.d.ts +39 -0
- package/dist/xlsx/edit/types.d.ts.map +1 -1
- package/dist/xlsx/formula/context.d.ts +13 -0
- package/dist/xlsx/formula/context.d.ts.map +1 -1
- package/dist/xlsx/formula/engine.d.ts.map +1 -1
- package/dist/xlsx/formula/evaluator.d.ts.map +1 -1
- package/dist/xlsx/formula/functions/helpers.d.ts +3 -2
- package/dist/xlsx/formula/functions/helpers.d.ts.map +1 -1
- package/dist/xlsx/formula/functions/text-regex.d.ts +8 -0
- package/dist/xlsx/formula/functions/text-regex.d.ts.map +1 -1
- package/dist/xlsx/formula/functions/text.d.ts.map +1 -1
- package/dist/xlsx/formula/functions/wildcard.d.ts +8 -0
- package/dist/xlsx/formula/functions/wildcard.d.ts.map +1 -0
- package/dist/xlsx/formula/values.d.ts +9 -0
- package/dist/xlsx/formula/values.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +9230 -3233
- package/dist/xlsx/index.d.ts +1 -0
- package/dist/xlsx/index.d.ts.map +1 -1
- package/dist/xlsx/index.mjs +9146 -3233
- package/dist/xlsx/layout/chart-view.d.ts.map +1 -1
- package/dist/xlsx/layout/header-footer-edit.d.ts +16 -0
- package/dist/xlsx/layout/header-footer-edit.d.ts.map +1 -0
- package/dist/xlsx/layout/index.d.ts +3 -0
- package/dist/xlsx/layout/index.d.ts.map +1 -1
- package/dist/xlsx/layout/page-break-view.d.ts +39 -0
- package/dist/xlsx/layout/page-break-view.d.ts.map +1 -0
- package/dist/xlsx/layout/page-view.d.ts +69 -0
- package/dist/xlsx/layout/page-view.d.ts.map +1 -0
- package/dist/xlsx/layout/ref-evaluator.d.ts.map +1 -1
- package/dist/xlsx/load/index.cjs +4528 -1707
- package/dist/xlsx/load/index.mjs +4527 -1706
- package/dist/xlsx/model-pivots.d.ts +88 -2
- package/dist/xlsx/model-pivots.d.ts.map +1 -1
- package/dist/xlsx/model-slicers.d.ts +146 -0
- package/dist/xlsx/model-slicers.d.ts.map +1 -0
- package/dist/xlsx/model-whatif.d.ts +51 -0
- package/dist/xlsx/model-whatif.d.ts.map +1 -0
- package/dist/xlsx/model.d.ts +26 -1
- package/dist/xlsx/model.d.ts.map +1 -1
- package/dist/xlsx/pivot/admission.d.ts.map +1 -1
- package/dist/xlsx/pivot/aggregate.d.ts +15 -6
- package/dist/xlsx/pivot/aggregate.d.ts.map +1 -1
- package/dist/xlsx/pivot/axes.d.ts +6 -0
- package/dist/xlsx/pivot/axes.d.ts.map +1 -0
- package/dist/xlsx/pivot/cache-xml.d.ts.map +1 -1
- package/dist/xlsx/pivot/columns.d.ts +48 -0
- package/dist/xlsx/pivot/columns.d.ts.map +1 -0
- package/dist/xlsx/pivot/data.d.ts +9 -3
- package/dist/xlsx/pivot/data.d.ts.map +1 -1
- package/dist/xlsx/pivot/date-axes.d.ts +12 -0
- package/dist/xlsx/pivot/date-axes.d.ts.map +1 -0
- package/dist/xlsx/pivot/date-group-read.d.ts +11 -0
- package/dist/xlsx/pivot/date-group-read.d.ts.map +1 -0
- package/dist/xlsx/pivot/date-groups.d.ts +60 -0
- package/dist/xlsx/pivot/date-groups.d.ts.map +1 -0
- package/dist/xlsx/pivot/date-read.d.ts +10 -0
- package/dist/xlsx/pivot/date-read.d.ts.map +1 -0
- package/dist/xlsx/pivot/dates.d.ts +17 -0
- package/dist/xlsx/pivot/dates.d.ts.map +1 -0
- package/dist/xlsx/pivot/group-read.d.ts +9 -0
- package/dist/xlsx/pivot/group-read.d.ts.map +1 -0
- package/dist/xlsx/pivot/groups.d.ts +31 -0
- package/dist/xlsx/pivot/groups.d.ts.map +1 -0
- package/dist/xlsx/pivot/hierarchy.d.ts +4 -1
- package/dist/xlsx/pivot/hierarchy.d.ts.map +1 -1
- package/dist/xlsx/pivot/index.d.ts +7 -0
- package/dist/xlsx/pivot/index.d.ts.map +1 -1
- package/dist/xlsx/pivot/item-filters-read.d.ts +7 -0
- package/dist/xlsx/pivot/item-filters-read.d.ts.map +1 -0
- package/dist/xlsx/pivot/item-filters.d.ts +23 -0
- package/dist/xlsx/pivot/item-filters.d.ts.map +1 -0
- package/dist/xlsx/pivot/measures.d.ts +6 -4
- package/dist/xlsx/pivot/measures.d.ts.map +1 -1
- package/dist/xlsx/pivot/nested.d.ts +8 -0
- package/dist/xlsx/pivot/nested.d.ts.map +1 -0
- package/dist/xlsx/pivot/page-filter-admission.d.ts.map +1 -1
- package/dist/xlsx/pivot/page-filter.d.ts.map +1 -1
- package/dist/xlsx/pivot/read.d.ts +2 -1
- package/dist/xlsx/pivot/read.d.ts.map +1 -1
- package/dist/xlsx/pivot/subtotal-read.d.ts +9 -0
- package/dist/xlsx/pivot/subtotal-read.d.ts.map +1 -0
- package/dist/xlsx/pivot/subtotals.d.ts +23 -0
- package/dist/xlsx/pivot/subtotals.d.ts.map +1 -0
- package/dist/xlsx/pivot/table-xml.d.ts +1 -1
- package/dist/xlsx/pivot/table-xml.d.ts.map +1 -1
- package/dist/xlsx/pivot/values-axis.d.ts +2 -2
- package/dist/xlsx/pivot/values-axis.d.ts.map +1 -1
- package/dist/xlsx/read/chart-ex.d.ts +9 -0
- package/dist/xlsx/read/chart-ex.d.ts.map +1 -0
- package/dist/xlsx/read/chart.d.ts.map +1 -1
- package/dist/xlsx/read/drawing.d.ts.map +1 -1
- package/dist/xlsx/read/load.d.ts.map +1 -1
- package/dist/xlsx/read/package.d.ts +2 -1
- package/dist/xlsx/read/package.d.ts.map +1 -1
- package/dist/xlsx/read/scenarios.d.ts +4 -0
- package/dist/xlsx/read/scenarios.d.ts.map +1 -0
- package/dist/xlsx/read/sheet-data.d.ts.map +1 -1
- package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
- package/dist/xlsx/read/tables.d.ts +3 -0
- package/dist/xlsx/read/tables.d.ts.map +1 -1
- package/dist/xlsx/read/worksheet.d.ts.map +1 -1
- package/dist/xlsx/slicer/book.d.ts +16 -0
- package/dist/xlsx/slicer/book.d.ts.map +1 -0
- package/dist/xlsx/slicer/frame.d.ts +14 -0
- package/dist/xlsx/slicer/frame.d.ts.map +1 -0
- package/dist/xlsx/slicer/index.d.ts +10 -0
- package/dist/xlsx/slicer/index.d.ts.map +1 -0
- package/dist/xlsx/slicer/items.d.ts +30 -0
- package/dist/xlsx/slicer/items.d.ts.map +1 -0
- package/dist/xlsx/slicer/layout.d.ts +67 -0
- package/dist/xlsx/slicer/layout.d.ts.map +1 -0
- package/dist/xlsx/slicer/read-slicers.d.ts +11 -0
- package/dist/xlsx/slicer/read-slicers.d.ts.map +1 -0
- package/dist/xlsx/slicer/read-timelines.d.ts +5 -0
- package/dist/xlsx/slicer/read-timelines.d.ts.map +1 -0
- package/dist/xlsx/slicer/read.d.ts +26 -0
- package/dist/xlsx/slicer/read.d.ts.map +1 -0
- package/dist/xlsx/slicer/select.d.ts +10 -0
- package/dist/xlsx/slicer/select.d.ts.map +1 -0
- package/dist/xlsx/slicer/styles.d.ts +36 -0
- package/dist/xlsx/slicer/styles.d.ts.map +1 -0
- package/dist/xlsx/slicer/table-filter.d.ts +28 -0
- package/dist/xlsx/slicer/table-filter.d.ts.map +1 -0
- package/dist/xlsx/slicer/timeline-periods.d.ts +35 -0
- package/dist/xlsx/slicer/timeline-periods.d.ts.map +1 -0
- package/dist/xlsx/slicer/timeline-view.d.ts +60 -0
- package/dist/xlsx/slicer/timeline-view.d.ts.map +1 -0
- package/dist/xlsx/slicer/write-plan.d.ts +31 -0
- package/dist/xlsx/slicer/write-plan.d.ts.map +1 -0
- package/dist/xlsx/slicer/write-timeline.d.ts +7 -0
- package/dist/xlsx/slicer/write-timeline.d.ts.map +1 -0
- package/dist/xlsx/slicer/write-xml.d.ts +17 -0
- package/dist/xlsx/slicer/write-xml.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/index.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/print-layout.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/slicers.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/slicers.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/what-if.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/what-if.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/icons.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/slicers.d.ts +37 -0
- package/dist/xlsx/ui/commands/slicers.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/what-if.d.ts +4 -0
- package/dist/xlsx/ui/commands/what-if.d.ts.map +1 -0
- package/dist/xlsx/ui/commands.d.ts +2 -0
- package/dist/xlsx/ui/commands.d.ts.map +1 -1
- package/dist/xlsx/ui/index.cjs +4201 -1316
- package/dist/xlsx/ui/index.d.ts +2 -0
- package/dist/xlsx/ui/index.d.ts.map +1 -1
- package/dist/xlsx/ui/index.mjs +4196 -1317
- package/dist/xlsx/ui/locales/de/shell.d.ts.map +1 -1
- package/dist/xlsx/ui/locales/en/shell.d.ts.map +1 -1
- package/dist/xlsx/ui/locales/es/shell.d.ts.map +1 -1
- package/dist/xlsx/ui/locales/fr/shell.d.ts.map +1 -1
- package/dist/xlsx/ui/locales/zh-CN/shell.d.ts.map +1 -1
- package/dist/xlsx/ui/ribbon/tabs/review-view.d.ts.map +1 -1
- package/dist/xlsx/write/carried-refs.d.ts.map +1 -1
- package/dist/xlsx/write/drawing.d.ts.map +1 -1
- package/dist/xlsx/write/package-writer.d.ts +2 -0
- package/dist/xlsx/write/package-writer.d.ts.map +1 -1
- package/dist/xlsx/write/save.d.ts.map +1 -1
- package/dist/xlsx/write/scenarios.d.ts +4 -0
- package/dist/xlsx/write/scenarios.d.ts.map +1 -0
- package/dist/xlsx/write/sheet-data.d.ts.map +1 -1
- package/dist/xlsx/write/sheet-parts.d.ts +1 -0
- package/dist/xlsx/write/sheet-parts.d.ts.map +1 -1
- package/dist/xlsx/write/sheet-props.d.ts.map +1 -1
- package/dist/xlsx/write/table-patch.d.ts.map +1 -1
- package/dist/xlsx/write/tables.d.ts.map +1 -1
- package/dist/xlsx/write/worksheet.d.ts.map +1 -1
- package/dist/xml/index.cjs +28 -0
- package/dist/xml/index.mjs +27 -1
- package/dist/xml/namespaces.d.ts +2 -0
- package/dist/xml/namespaces.d.ts.map +1 -1
- package/dist/xml/xml.d.ts +15 -0
- package/dist/xml/xml.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/PptxHandler-RWTOUCLC.mjs +0 -3
- package/dist/PptxHandler-UU4ZCT6H.cjs +0 -12
- package/dist/chunk-KBIJI6P5.mjs +0 -166
- package/dist/pptx/chunks/elements-DmbzOhFu.d.ts.map +0 -1
- package/dist/pptx/chunks/index-BmvOxbsh.d.ts.map +0 -1
package/dist/crypto/decrypt.d.ts
CHANGED
|
@@ -4,16 +4,28 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Moved from `src/core/pptx/core/utils/ooxml-crypto-decrypt.ts` (see PROVENANCE.md).
|
|
6
6
|
*/
|
|
7
|
+
import type { SpinLimits } from '../digest/password-hash.js';
|
|
7
8
|
import type { EncryptionInfo, StandardEncryptionInfo } from './types.js';
|
|
9
|
+
/** Options of agile password verification and package decryption. */
|
|
10
|
+
export interface DecryptOptions extends SpinLimits {
|
|
11
|
+
/**
|
|
12
|
+
* Accept an agile package that has no `<dataIntegrity>` element (default false). The HMAC is
|
|
13
|
+
* the only protection of the ciphertext against tampering, so a missing element is treated as
|
|
14
|
+
* a downgrade attack unless the caller opts out (for example for a legacy writer).
|
|
15
|
+
*/
|
|
16
|
+
allowMissingIntegrity?: boolean;
|
|
17
|
+
}
|
|
8
18
|
/**
|
|
9
19
|
* Verify the password against agile encryption info and return the
|
|
10
20
|
* decryption key if valid.
|
|
11
21
|
*
|
|
12
22
|
* @param info - Parsed agile encryption info.
|
|
13
23
|
* @param password - The password to verify.
|
|
24
|
+
* @param limits - The spin-count limit (default 1,000,000; the spec ceiling is 10,000,000).
|
|
14
25
|
* @returns The document encryption key, or null if the password is wrong.
|
|
26
|
+
* @throws Error when the EncryptionInfo parameters are invalid or the spin count is too large.
|
|
15
27
|
*/
|
|
16
|
-
export declare function verifyAgilePassword(info: EncryptionInfo, password: string): Promise<Uint8Array | null>;
|
|
28
|
+
export declare function verifyAgilePassword(info: EncryptionInfo, password: string, limits?: SpinLimits): Promise<Uint8Array | null>;
|
|
17
29
|
/**
|
|
18
30
|
* Verify the password against standard encryption info and return the
|
|
19
31
|
* decryption key if valid.
|
|
@@ -35,9 +47,11 @@ export declare function verifyStandardPassword(info: StandardEncryptionInfo, pas
|
|
|
35
47
|
* @param info - Parsed agile encryption info.
|
|
36
48
|
* @param key - The document encryption key.
|
|
37
49
|
* @param encryptedPackage - Raw bytes of the EncryptedPackage stream.
|
|
38
|
-
* @
|
|
50
|
+
* @param options - `allowMissingIntegrity` accepts a package without a dataIntegrity element.
|
|
51
|
+
* @throws DataIntegrityError if the data integrity check fails, or the element is missing and
|
|
52
|
+
* `allowMissingIntegrity` is not set (an attacker could strip it to flip ciphertext bits).
|
|
39
53
|
*/
|
|
40
|
-
export declare function verifyAgileDataIntegrity(info: EncryptionInfo, key: Uint8Array, encryptedPackage: Uint8Array): Promise<void>;
|
|
54
|
+
export declare function verifyAgileDataIntegrity(info: EncryptionInfo, key: Uint8Array, encryptedPackage: Uint8Array, options?: Pick<DecryptOptions, 'allowMissingIntegrity'>): Promise<void>;
|
|
41
55
|
/**
|
|
42
56
|
* Decrypt the EncryptedPackage stream using the agile encryption key.
|
|
43
57
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decrypt.d.ts","sourceRoot":"","sources":["../../crypto/decrypt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"decrypt.d.ts","sourceRoot":"","sources":["../../crypto/decrypt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAW1D,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGtE,qEAAqE;AACrE,MAAM,WAAW,cAAe,SAAQ,UAAU;IACjD;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAChC;AAMD;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACxC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,UAAe,GACrB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAsC5B;AAMD;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC3C,IAAI,EAAE,sBAAsB,EAC5B,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAuB5B;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,wBAAwB,CAC7C,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,UAAU,EACf,gBAAgB,EAAE,UAAU,EAC5B,OAAO,GAAE,IAAI,CAAC,cAAc,EAAE,uBAAuB,CAAM,GACzD,OAAO,CAAC,IAAI,CAAC,CAkDf;AAeD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACxC,gBAAgB,EAAE,UAAU,EAC5B,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,cAAc,GAClB,OAAO,CAAC,WAAW,CAAC,CAuCtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC3C,gBAAgB,EAAE,UAAU,EAC5B,GAAG,EAAE,UAAU,GACb,OAAO,CAAC,WAAW,CAAC,CActB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption-info.d.ts","sourceRoot":"","sources":["../../crypto/encryption-info.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"encryption-info.d.ts","sourceRoot":"","sources":["../../crypto/encryption-info.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGtE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,QAAS,CAAC;AAEjC;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc,GAAG,sBAAsB,CAa7F"}
|
package/dist/crypto/index.cjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var xmldom = require('@xmldom/xmldom');
|
|
4
|
+
|
|
3
5
|
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole2-parser-types.js
|
|
4
6
|
var OLE_MAGIC = new Uint8Array([208, 207, 17, 224, 161, 177, 26, 225]);
|
|
5
7
|
var ENDOFCHAIN = 4294967294;
|
|
@@ -555,6 +557,14 @@ async function hmac(algorithm, key, data) {
|
|
|
555
557
|
return new Uint8Array(result);
|
|
556
558
|
}
|
|
557
559
|
|
|
560
|
+
// digest/timing-safe.ts
|
|
561
|
+
function timingSafeEqual(a, b) {
|
|
562
|
+
if (a.length !== b.length) return false;
|
|
563
|
+
let difference = 0;
|
|
564
|
+
for (let i2 = 0; i2 < a.length; i2++) difference |= a[i2] ^ b[i2];
|
|
565
|
+
return difference === 0;
|
|
566
|
+
}
|
|
567
|
+
|
|
558
568
|
// crypto/aes-ecb.ts
|
|
559
569
|
var BLOCK = 16;
|
|
560
570
|
var BATCH = 4096;
|
|
@@ -2338,6 +2348,14 @@ function digestFunction(name) {
|
|
|
2338
2348
|
return canonical && DIGESTS[canonical];
|
|
2339
2349
|
}
|
|
2340
2350
|
|
|
2351
|
+
// digest/password-hash.ts
|
|
2352
|
+
var MAX_SPIN_COUNT = 1e7;
|
|
2353
|
+
var DEFAULT_MAX_SPIN_COUNT = 1e6;
|
|
2354
|
+
function isValidSpinCount(spinCount, maxSpinCount = DEFAULT_MAX_SPIN_COUNT) {
|
|
2355
|
+
const limit = Math.min(maxSpinCount, MAX_SPIN_COUNT);
|
|
2356
|
+
return spinCount === void 0 || Number.isInteger(spinCount) && spinCount >= 0 && spinCount <= limit;
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2341
2359
|
// crypto/key-derivation.ts
|
|
2342
2360
|
var BLOCK_KEYS = {
|
|
2343
2361
|
verifierHashInput: new Uint8Array([254, 167, 210, 118, 59, 75, 158, 121]),
|
|
@@ -2346,9 +2364,9 @@ var BLOCK_KEYS = {
|
|
|
2346
2364
|
dataIntegrityHmacKey: new Uint8Array([95, 178, 173, 1, 12, 185, 225, 246]),
|
|
2347
2365
|
dataIntegrityHmacValue: new Uint8Array([160, 103, 127, 2, 178, 44, 132, 51])
|
|
2348
2366
|
};
|
|
2349
|
-
var
|
|
2350
|
-
async function spinPassword(password, salt, spinCount, hashAlgorithm) {
|
|
2351
|
-
if (!
|
|
2367
|
+
var SPIN_CHUNK = 1e5;
|
|
2368
|
+
async function spinPassword(password, salt, spinCount, hashAlgorithm, limits = {}) {
|
|
2369
|
+
if (!isValidSpinCount(spinCount, limits.maxSpinCount)) {
|
|
2352
2370
|
throw new Error(`Unsupported encryption spin count: ${spinCount}.`);
|
|
2353
2371
|
}
|
|
2354
2372
|
const passwordBytes = encodePasswordUtf16LE(password);
|
|
@@ -2361,6 +2379,9 @@ async function spinPassword(password, salt, spinCount, hashAlgorithm) {
|
|
|
2361
2379
|
view.setUint32(0, i2, true);
|
|
2362
2380
|
buffer.set(h3, 4);
|
|
2363
2381
|
h3 = digest(buffer);
|
|
2382
|
+
if (i2 % SPIN_CHUNK === SPIN_CHUNK - 1 && i2 + 1 < spinCount) {
|
|
2383
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
2384
|
+
}
|
|
2364
2385
|
}
|
|
2365
2386
|
return h3;
|
|
2366
2387
|
}
|
|
@@ -2379,8 +2400,8 @@ async function extendKey(h2, hashAlgorithm, keyLength) {
|
|
|
2379
2400
|
const x3 = concatArrays(await pad2(54), await pad2(92));
|
|
2380
2401
|
return x3.subarray(0, keyLength);
|
|
2381
2402
|
}
|
|
2382
|
-
function computeAgileKeyBase(password, salt, spinCount, hashAlgorithm) {
|
|
2383
|
-
return spinPassword(password, salt, spinCount, hashAlgorithm);
|
|
2403
|
+
function computeAgileKeyBase(password, salt, spinCount, hashAlgorithm, limits = {}) {
|
|
2404
|
+
return spinPassword(password, salt, spinCount, hashAlgorithm, limits);
|
|
2384
2405
|
}
|
|
2385
2406
|
async function deriveAgileKeyFromBase(base, hashAlgorithm, blockKey, keyBits, hashSize) {
|
|
2386
2407
|
const h2 = await hash(hashAlgorithm, concatArrays(base, blockKey));
|
|
@@ -2411,10 +2432,82 @@ async function generateIV(hashAlgorithm, salt, blockKey, blockSize) {
|
|
|
2411
2432
|
return padded;
|
|
2412
2433
|
}
|
|
2413
2434
|
|
|
2435
|
+
// crypto/validate.ts
|
|
2436
|
+
var AGILE_DIGEST_LENGTH = {
|
|
2437
|
+
"SHA-1": 20,
|
|
2438
|
+
"SHA-256": 32,
|
|
2439
|
+
"SHA-384": 48,
|
|
2440
|
+
"SHA-512": 64
|
|
2441
|
+
};
|
|
2442
|
+
function agileDigestLength(hashAlgorithm) {
|
|
2443
|
+
const name = normalizeDigestAlgorithmName(hashAlgorithm);
|
|
2444
|
+
return name === void 0 ? void 0 : AGILE_DIGEST_LENGTH[name];
|
|
2445
|
+
}
|
|
2446
|
+
var KEY_BITS = /* @__PURE__ */ new Set([128, 192, 256]);
|
|
2447
|
+
function assertBlock(block, what) {
|
|
2448
|
+
if (block.cipherAlgorithm !== "AES") {
|
|
2449
|
+
throw new Error(`Unsupported ${what} cipherAlgorithm: ${block.cipherAlgorithm}.`);
|
|
2450
|
+
}
|
|
2451
|
+
if (block.cipherChaining !== "ChainingModeCBC") {
|
|
2452
|
+
throw new Error(`Unsupported ${what} cipherChaining: ${block.cipherChaining}.`);
|
|
2453
|
+
}
|
|
2454
|
+
const digestLength = agileDigestLength(block.hashAlgorithm);
|
|
2455
|
+
if (digestLength === void 0) {
|
|
2456
|
+
throw new Error(`Unsupported ${what} hashAlgorithm: ${block.hashAlgorithm}.`);
|
|
2457
|
+
}
|
|
2458
|
+
if (block.hashSize !== digestLength) {
|
|
2459
|
+
throw new Error(
|
|
2460
|
+
`Invalid ${what} hashSize ${block.hashSize}: ${block.hashAlgorithm} produces ${digestLength} bytes.`
|
|
2461
|
+
);
|
|
2462
|
+
}
|
|
2463
|
+
if (!KEY_BITS.has(block.keyBits)) throw new Error(`Invalid ${what} keyBits: ${block.keyBits}.`);
|
|
2464
|
+
if (block.blockSize !== 16) throw new Error(`Invalid ${what} blockSize: ${block.blockSize}.`);
|
|
2465
|
+
if (!Number.isInteger(block.saltSize) || block.saltSize <= 0 || block.saltSize > 64) {
|
|
2466
|
+
throw new Error(`Invalid ${what} saltSize: ${block.saltSize}.`);
|
|
2467
|
+
}
|
|
2468
|
+
if (block.saltValue.length !== block.saltSize) {
|
|
2469
|
+
throw new Error(`The ${what} saltValue does not match its saltSize.`);
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
function assertValidAgileEncryptionInfo(info) {
|
|
2473
|
+
assertBlock(info.keyData, "keyData");
|
|
2474
|
+
const pke = info.passwordKeyEncryptor;
|
|
2475
|
+
assertBlock(pke, "password key encryptor");
|
|
2476
|
+
if (!Number.isInteger(pke.spinCount) || pke.spinCount < 0) {
|
|
2477
|
+
throw new Error(`Invalid spinCount: ${pke.spinCount}.`);
|
|
2478
|
+
}
|
|
2479
|
+
if (pke.saltSize > pke.hashSize) {
|
|
2480
|
+
throw new Error(`Invalid password key encryptor saltSize: ${pke.saltSize}.`);
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
function assertValidStandardEncryptionInfo(info) {
|
|
2484
|
+
if (!KEY_BITS.has(info.header.keySize)) {
|
|
2485
|
+
throw new Error(`Invalid Standard encryption keySize: ${info.header.keySize}.`);
|
|
2486
|
+
}
|
|
2487
|
+
if (info.verifier.salt.length !== 16 || info.verifier.saltSize !== 16) {
|
|
2488
|
+
throw new Error(`Invalid Standard encryption saltSize: ${info.verifier.saltSize}.`);
|
|
2489
|
+
}
|
|
2490
|
+
if (info.verifier.verifierHashSize !== 20) {
|
|
2491
|
+
throw new Error(
|
|
2492
|
+
`Invalid Standard encryption verifierHashSize: ${info.verifier.verifierHashSize}.`
|
|
2493
|
+
);
|
|
2494
|
+
}
|
|
2495
|
+
if (info.verifier.encryptedVerifier.length !== 16 || info.verifier.encryptedVerifierHash.length < 20) {
|
|
2496
|
+
throw new Error("The Standard encryption verifier is truncated.");
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2414
2500
|
// crypto/decrypt.ts
|
|
2415
|
-
async function verifyAgilePassword(info, password) {
|
|
2501
|
+
async function verifyAgilePassword(info, password, limits = {}) {
|
|
2502
|
+
assertValidAgileEncryptionInfo(info);
|
|
2416
2503
|
const pke = info.passwordKeyEncryptor;
|
|
2417
|
-
const base = await computeAgileKeyBase(
|
|
2504
|
+
const base = await computeAgileKeyBase(
|
|
2505
|
+
password,
|
|
2506
|
+
pke.saltValue,
|
|
2507
|
+
pke.spinCount,
|
|
2508
|
+
pke.hashAlgorithm,
|
|
2509
|
+
limits
|
|
2510
|
+
);
|
|
2418
2511
|
const blockKey = (block) => deriveAgileKeyFromBase(base, pke.hashAlgorithm, block, pke.keyBits, pke.hashSize);
|
|
2419
2512
|
const verifierHashInput = await aesCbcDecryptRaw(
|
|
2420
2513
|
await blockKey(BLOCK_KEYS.verifierHashInput),
|
|
@@ -2427,10 +2520,8 @@ async function verifyAgilePassword(info, password) {
|
|
|
2427
2520
|
pke.encryptedVerifierHashValue
|
|
2428
2521
|
);
|
|
2429
2522
|
const computedHash = await hash(pke.hashAlgorithm, verifierHashInput.subarray(0, pke.saltSize));
|
|
2430
|
-
if (computedHash.length
|
|
2431
|
-
|
|
2432
|
-
for (let i2 = 0; i2 < pke.hashSize; i2++) difference |= verifierHashValue[i2] ^ computedHash[i2];
|
|
2433
|
-
if (difference !== 0) return null;
|
|
2523
|
+
if (computedHash.length !== pke.hashSize || verifierHashValue.length < pke.hashSize) return null;
|
|
2524
|
+
if (!timingSafeEqual(verifierHashValue.subarray(0, pke.hashSize), computedHash)) return null;
|
|
2434
2525
|
const decryptedKey = await aesCbcDecryptRaw(
|
|
2435
2526
|
await blockKey(BLOCK_KEYS.encryptedKeyValue),
|
|
2436
2527
|
pke.saltValue,
|
|
@@ -2439,6 +2530,7 @@ async function verifyAgilePassword(info, password) {
|
|
|
2439
2530
|
return decryptedKey.subarray(0, info.keyData.keyBits / 8);
|
|
2440
2531
|
}
|
|
2441
2532
|
async function verifyStandardPassword(info, password) {
|
|
2533
|
+
assertValidStandardEncryptionInfo(info);
|
|
2442
2534
|
const key = await deriveStandardKey(
|
|
2443
2535
|
password,
|
|
2444
2536
|
info.verifier.salt,
|
|
@@ -2448,20 +2540,16 @@ async function verifyStandardPassword(info, password) {
|
|
|
2448
2540
|
const decryptedVerifier = await aesEcbDecrypt(key, info.verifier.encryptedVerifier);
|
|
2449
2541
|
const decryptedHash = await aesEcbDecrypt(key, info.verifier.encryptedVerifierHash);
|
|
2450
2542
|
const computedHash = await hash("SHA-1", decryptedVerifier);
|
|
2451
|
-
const
|
|
2452
|
-
let match = true;
|
|
2453
|
-
for (let i2 = 0; i2 < Math.min(hashSize, 20); i2++) {
|
|
2454
|
-
if (computedHash[i2] !== decryptedHash[i2]) {
|
|
2455
|
-
match = false;
|
|
2456
|
-
break;
|
|
2457
|
-
}
|
|
2458
|
-
}
|
|
2543
|
+
const match = timingSafeEqual(decryptedHash.subarray(0, 20), computedHash);
|
|
2459
2544
|
return match ? key : null;
|
|
2460
2545
|
}
|
|
2461
|
-
async function verifyAgileDataIntegrity(info, key, encryptedPackage) {
|
|
2546
|
+
async function verifyAgileDataIntegrity(info, key, encryptedPackage, options = {}) {
|
|
2462
2547
|
const keyData = info.keyData;
|
|
2463
2548
|
if (!info.dataIntegrity) {
|
|
2464
|
-
return;
|
|
2549
|
+
if (options.allowMissingIntegrity) return;
|
|
2550
|
+
throw new DataIntegrityError(
|
|
2551
|
+
"The encrypted package has no data integrity record, so it cannot be checked for tampering."
|
|
2552
|
+
);
|
|
2465
2553
|
}
|
|
2466
2554
|
const hmacKeyIV = await generateIV(
|
|
2467
2555
|
keyData.hashAlgorithm,
|
|
@@ -2488,28 +2576,26 @@ async function verifyAgileDataIntegrity(info, key, encryptedPackage) {
|
|
|
2488
2576
|
);
|
|
2489
2577
|
const expectedHmac = decryptedHmacValue.subarray(0, keyData.hashSize);
|
|
2490
2578
|
const computedHmac = await hmac(keyData.hashAlgorithm, hmacKey, encryptedPackage);
|
|
2491
|
-
|
|
2492
|
-
if (computedHmac.length < keyData.hashSize) {
|
|
2493
|
-
match = false;
|
|
2494
|
-
} else {
|
|
2495
|
-
for (let i2 = 0; i2 < keyData.hashSize; i2++) {
|
|
2496
|
-
if (computedHmac[i2] !== expectedHmac[i2]) {
|
|
2497
|
-
match = false;
|
|
2498
|
-
break;
|
|
2499
|
-
}
|
|
2500
|
-
}
|
|
2501
|
-
}
|
|
2579
|
+
const match = timingSafeEqual(computedHmac, expectedHmac);
|
|
2502
2580
|
if (!match) {
|
|
2503
2581
|
throw new DataIntegrityError(
|
|
2504
2582
|
"Data integrity check failed. The encrypted file may be corrupted or tampered with."
|
|
2505
2583
|
);
|
|
2506
2584
|
}
|
|
2507
2585
|
}
|
|
2586
|
+
function readOriginalSize(encryptedPackage, wide) {
|
|
2587
|
+
if (encryptedPackage.length < 8) throw new Error("The EncryptedPackage stream is truncated.");
|
|
2588
|
+
const view = new DataView(encryptedPackage.buffer, encryptedPackage.byteOffset, 8);
|
|
2589
|
+
const high = view.getUint32(4, true);
|
|
2590
|
+
return view.getUint32(0, true) + (wide ? high * 4294967296 : 0);
|
|
2591
|
+
}
|
|
2508
2592
|
async function decryptAgilePackage(encryptedPackage, key, info) {
|
|
2509
2593
|
const keyData = info.keyData;
|
|
2510
|
-
const
|
|
2511
|
-
const originalSize = sizeView.getUint32(0, true) + sizeView.getUint32(4, true) * 4294967296;
|
|
2594
|
+
const originalSize = readOriginalSize(encryptedPackage, true);
|
|
2512
2595
|
const encryptedData = encryptedPackage.subarray(8);
|
|
2596
|
+
if (originalSize > encryptedData.length) {
|
|
2597
|
+
throw new Error("The declared package size exceeds the encrypted data.");
|
|
2598
|
+
}
|
|
2513
2599
|
const segmentSize = 4096;
|
|
2514
2600
|
const result = new Uint8Array(originalSize);
|
|
2515
2601
|
let resultOffset = 0;
|
|
@@ -2533,9 +2619,11 @@ async function decryptAgilePackage(encryptedPackage, key, info) {
|
|
|
2533
2619
|
return result.buffer;
|
|
2534
2620
|
}
|
|
2535
2621
|
async function decryptStandardPackage(encryptedPackage, key) {
|
|
2536
|
-
const
|
|
2537
|
-
const originalSize = sizeView.getUint32(0, true);
|
|
2622
|
+
const originalSize = readOriginalSize(encryptedPackage, false);
|
|
2538
2623
|
const encryptedData = encryptedPackage.subarray(8);
|
|
2624
|
+
if (originalSize > encryptedData.length) {
|
|
2625
|
+
throw new Error("The declared package size exceeds the encrypted data.");
|
|
2626
|
+
}
|
|
2539
2627
|
const decrypted = await aesEcbDecrypt(key, encryptedData);
|
|
2540
2628
|
return decrypted.slice(0, originalSize).buffer;
|
|
2541
2629
|
}
|
|
@@ -3118,6 +3206,52 @@ async function encryptStandard(packageData, password, options = {}) {
|
|
|
3118
3206
|
);
|
|
3119
3207
|
return container(encryptionInfo, await encryptStandardPackage(packageData, key));
|
|
3120
3208
|
}
|
|
3209
|
+
var DEFAULT_XML_LIMITS = {
|
|
3210
|
+
maxDepth: 512,
|
|
3211
|
+
maxNodes: 5e6
|
|
3212
|
+
};
|
|
3213
|
+
var MARKUP_RE = /<!--[\s\S]*?-->|<!\[CDATA\[[\s\S]*?\]\]>|<\?[\s\S]*?\?>|<(\/?)([^\s\/>]+)(?:\s+[^\s=\/>]+\s*=\s*(?:"[^"]*"|'[^']*'))*\s*(\/?)>/g;
|
|
3214
|
+
function checkXmlLimits(xml, label, limits = {}) {
|
|
3215
|
+
const maxDepth = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
|
|
3216
|
+
const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
|
|
3217
|
+
let depth = 0;
|
|
3218
|
+
let nodes = 0;
|
|
3219
|
+
for (const match of xml.matchAll(MARKUP_RE)) {
|
|
3220
|
+
const [, closing, name, selfClosing] = match;
|
|
3221
|
+
if (name === void 0) continue;
|
|
3222
|
+
if (closing) {
|
|
3223
|
+
depth--;
|
|
3224
|
+
continue;
|
|
3225
|
+
}
|
|
3226
|
+
nodes++;
|
|
3227
|
+
if (nodes > maxNodes) throw new Error(`${label} XML exceeds the limit of ${maxNodes} elements`);
|
|
3228
|
+
if (!selfClosing && ++depth > maxDepth)
|
|
3229
|
+
throw new Error(`${label} XML exceeds the nesting depth limit of ${maxDepth}`);
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3232
|
+
function parseXml(xml, options = {}) {
|
|
3233
|
+
const label = options.label ?? "OOXML";
|
|
3234
|
+
if (/<!DOCTYPE|<!ENTITY/i.test(xml))
|
|
3235
|
+
throw new Error(`${label} XML with DTD or entity declarations is not supported`);
|
|
3236
|
+
checkXmlLimits(xml, label, options.limits);
|
|
3237
|
+
let parseError = "";
|
|
3238
|
+
let parsed;
|
|
3239
|
+
try {
|
|
3240
|
+
parsed = new xmldom.DOMParser({
|
|
3241
|
+
onError: (level, message) => {
|
|
3242
|
+
if (level !== "warning") parseError = message;
|
|
3243
|
+
}
|
|
3244
|
+
}).parseFromString(xml, "application/xml");
|
|
3245
|
+
} catch (error) {
|
|
3246
|
+
throw new Error(
|
|
3247
|
+
`Invalid ${label} XML: ${error instanceof Error ? error.message : String(error)}`,
|
|
3248
|
+
{ cause: error }
|
|
3249
|
+
);
|
|
3250
|
+
}
|
|
3251
|
+
if (parseError || !parsed.documentElement)
|
|
3252
|
+
throw new Error(`Invalid ${label} XML: ${parseError || "missing root element"}`);
|
|
3253
|
+
return parsed;
|
|
3254
|
+
}
|
|
3121
3255
|
|
|
3122
3256
|
// crypto/encryption-info.ts
|
|
3123
3257
|
var RC4_ALG_ID = 26625;
|
|
@@ -3180,53 +3314,87 @@ function parseStandardEncryptionInfo(data) {
|
|
|
3180
3314
|
}
|
|
3181
3315
|
};
|
|
3182
3316
|
}
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3317
|
+
var PASSWORD_KEY_ENCRYPTOR_URI = "http://schemas.microsoft.com/office/2006/keyEncryptor/password";
|
|
3318
|
+
function childrenNamed(parent, localName) {
|
|
3319
|
+
const found = [];
|
|
3320
|
+
for (let node = parent.firstChild; node; node = node.nextSibling) {
|
|
3321
|
+
if (node.nodeType === 1 && node.localName === localName) {
|
|
3322
|
+
found.push(node);
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
return found;
|
|
3188
3326
|
}
|
|
3189
|
-
function
|
|
3190
|
-
const
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3327
|
+
function singleChild(parent, localName, mustExist) {
|
|
3328
|
+
const matches = childrenNamed(parent, localName);
|
|
3329
|
+
if (matches.length > 1) throw new Error(`The EncryptionInfo has several ${localName} elements.`);
|
|
3330
|
+
if (matches.length === 0 && mustExist) {
|
|
3331
|
+
throw new Error(`The EncryptionInfo has no ${localName} element.`);
|
|
3332
|
+
}
|
|
3333
|
+
return matches[0];
|
|
3334
|
+
}
|
|
3335
|
+
function required(element, attr) {
|
|
3336
|
+
const value = element.getAttribute(attr);
|
|
3337
|
+
if (!value) throw new Error(`The EncryptionInfo ${element.localName} has no ${attr}.`);
|
|
3338
|
+
return value;
|
|
3339
|
+
}
|
|
3340
|
+
function requiredInt(element, attr) {
|
|
3341
|
+
const value = required(element, attr);
|
|
3342
|
+
if (!/^\d{1,10}$/.test(value)) {
|
|
3343
|
+
throw new Error(`The EncryptionInfo ${element.localName} ${attr} is not a number: ${value}.`);
|
|
3344
|
+
}
|
|
3345
|
+
return Number(value);
|
|
3346
|
+
}
|
|
3347
|
+
function parseKeyBlock(element) {
|
|
3196
3348
|
return {
|
|
3349
|
+
saltSize: requiredInt(element, "saltSize"),
|
|
3350
|
+
blockSize: requiredInt(element, "blockSize"),
|
|
3351
|
+
keyBits: requiredInt(element, "keyBits"),
|
|
3352
|
+
hashSize: requiredInt(element, "hashSize"),
|
|
3353
|
+
cipherAlgorithm: required(element, "cipherAlgorithm"),
|
|
3354
|
+
cipherChaining: required(element, "cipherChaining"),
|
|
3355
|
+
hashAlgorithm: required(element, "hashAlgorithm"),
|
|
3356
|
+
saltValue: base64Decode(required(element, "saltValue"))
|
|
3357
|
+
};
|
|
3358
|
+
}
|
|
3359
|
+
function parseAgileEncryptionInfo(data) {
|
|
3360
|
+
const root = parseXml(new TextDecoder("utf-8").decode(data.subarray(8)), {
|
|
3361
|
+
label: "EncryptionInfo"
|
|
3362
|
+
}).documentElement;
|
|
3363
|
+
if (root.localName !== "encryption") {
|
|
3364
|
+
throw new Error("The EncryptionInfo root element is not <encryption>.");
|
|
3365
|
+
}
|
|
3366
|
+
const keyData = parseKeyBlock(singleChild(root, "keyData", true));
|
|
3367
|
+
const integrity = singleChild(root, "dataIntegrity", false);
|
|
3368
|
+
const encryptors = childrenNamed(singleChild(root, "keyEncryptors", true), "keyEncryptor");
|
|
3369
|
+
const passwordEncryptors = encryptors.filter(
|
|
3370
|
+
(encryptor) => encryptor.getAttribute("uri") === PASSWORD_KEY_ENCRYPTOR_URI
|
|
3371
|
+
);
|
|
3372
|
+
if (passwordEncryptors.length !== 1) {
|
|
3373
|
+
throw new Error(
|
|
3374
|
+
passwordEncryptors.length === 0 ? "The EncryptionInfo has no password key encryptor." : "The EncryptionInfo has several password key encryptors."
|
|
3375
|
+
);
|
|
3376
|
+
}
|
|
3377
|
+
const pke = singleChild(passwordEncryptors[0], "encryptedKey", true);
|
|
3378
|
+
const info = {
|
|
3197
3379
|
version: { major: 4, minor: 4 },
|
|
3198
3380
|
isAgile: true,
|
|
3199
|
-
keyData
|
|
3200
|
-
|
|
3201
|
-
blockSize: int(keyData("blockSize")),
|
|
3202
|
-
keyBits: int(keyData("keyBits")),
|
|
3203
|
-
hashSize: int(keyData("hashSize")),
|
|
3204
|
-
cipherAlgorithm: keyData("cipherAlgorithm"),
|
|
3205
|
-
cipherChaining: keyData("cipherChaining"),
|
|
3206
|
-
hashAlgorithm: keyData("hashAlgorithm"),
|
|
3207
|
-
saltValue: base64Decode(keyData("saltValue"))
|
|
3208
|
-
},
|
|
3209
|
-
...encryptedHmacKey ? {
|
|
3381
|
+
keyData,
|
|
3382
|
+
...integrity ? {
|
|
3210
3383
|
dataIntegrity: {
|
|
3211
|
-
encryptedHmacKey: base64Decode(encryptedHmacKey),
|
|
3212
|
-
encryptedHmacValue: base64Decode(integrity
|
|
3384
|
+
encryptedHmacKey: base64Decode(required(integrity, "encryptedHmacKey")),
|
|
3385
|
+
encryptedHmacValue: base64Decode(required(integrity, "encryptedHmacValue"))
|
|
3213
3386
|
}
|
|
3214
3387
|
} : {},
|
|
3215
3388
|
passwordKeyEncryptor: {
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
cipherChaining: pke("cipherChaining"),
|
|
3222
|
-
hashAlgorithm: pke("hashAlgorithm"),
|
|
3223
|
-
saltValue: base64Decode(pke("saltValue")),
|
|
3224
|
-
spinCount: int(pke("spinCount")),
|
|
3225
|
-
encryptedVerifierHashInput: base64Decode(pke("encryptedVerifierHashInput")),
|
|
3226
|
-
encryptedVerifierHashValue: base64Decode(pke("encryptedVerifierHashValue")),
|
|
3227
|
-
encryptedKeyValue: base64Decode(pke("encryptedKeyValue"))
|
|
3389
|
+
...parseKeyBlock(pke),
|
|
3390
|
+
spinCount: requiredInt(pke, "spinCount"),
|
|
3391
|
+
encryptedVerifierHashInput: base64Decode(required(pke, "encryptedVerifierHashInput")),
|
|
3392
|
+
encryptedVerifierHashValue: base64Decode(required(pke, "encryptedVerifierHashValue")),
|
|
3393
|
+
encryptedKeyValue: base64Decode(required(pke, "encryptedKeyValue"))
|
|
3228
3394
|
}
|
|
3229
3395
|
};
|
|
3396
|
+
assertValidAgileEncryptionInfo(info);
|
|
3397
|
+
return info;
|
|
3230
3398
|
}
|
|
3231
3399
|
|
|
3232
3400
|
// crypto/index.ts
|
|
@@ -3242,7 +3410,7 @@ function streams(bytes) {
|
|
|
3242
3410
|
}
|
|
3243
3411
|
throw new Error("EncryptedPackage stream not found. The file may be corrupted.");
|
|
3244
3412
|
}
|
|
3245
|
-
async function decryptOoxmlPackage(input, password) {
|
|
3413
|
+
async function decryptOoxmlPackage(input, password, options = {}) {
|
|
3246
3414
|
const { info: infoStream, data } = streams(toBytes(input));
|
|
3247
3415
|
const info = parseEncryptionInfo(infoStream);
|
|
3248
3416
|
if (isStandard(info)) {
|
|
@@ -3250,21 +3418,26 @@ async function decryptOoxmlPackage(input, password) {
|
|
|
3250
3418
|
if (!key2) throw new IncorrectPasswordError();
|
|
3251
3419
|
return new Uint8Array(await decryptStandardPackage(data, key2));
|
|
3252
3420
|
}
|
|
3253
|
-
const key = await verifyAgilePassword(info, password);
|
|
3421
|
+
const key = await verifyAgilePassword(info, password, options);
|
|
3254
3422
|
if (!key) throw new IncorrectPasswordError();
|
|
3255
|
-
await verifyAgileDataIntegrity(info, key, data);
|
|
3423
|
+
await verifyAgileDataIntegrity(info, key, data, options);
|
|
3256
3424
|
return new Uint8Array(await decryptAgilePackage(data, key, info));
|
|
3257
3425
|
}
|
|
3426
|
+
function inspectOoxmlEncryption(input) {
|
|
3427
|
+
const info = parseEncryptionInfo(streams(toBytes(input)).info);
|
|
3428
|
+
if (isStandard(info)) return { scheme: "standard", integrityProtected: false };
|
|
3429
|
+
return { scheme: "agile", integrityProtected: info.dataIntegrity !== void 0 };
|
|
3430
|
+
}
|
|
3258
3431
|
function encryptOoxmlPackage(input, password, options = {}) {
|
|
3259
3432
|
const bytes = toBytes(input);
|
|
3260
3433
|
return options.encryptionScheme === "standard" ? encryptStandard(bytes, password, options) : encryptAgile(bytes, password, options);
|
|
3261
3434
|
}
|
|
3262
|
-
async function verifyOoxmlPackagePassword(input, password) {
|
|
3435
|
+
async function verifyOoxmlPackagePassword(input, password, options = {}) {
|
|
3263
3436
|
try {
|
|
3264
3437
|
const opened = openEncryptedPackage(input);
|
|
3265
3438
|
if (!opened) return false;
|
|
3266
3439
|
const info = parseEncryptionInfo(opened.encryptionInfo);
|
|
3267
|
-
const key = isStandard(info) ? await verifyStandardPassword(info, password) : await verifyAgilePassword(info, password);
|
|
3440
|
+
const key = isStandard(info) ? await verifyStandardPassword(info, password) : await verifyAgilePassword(info, password, options);
|
|
3268
3441
|
return key !== null;
|
|
3269
3442
|
} catch {
|
|
3270
3443
|
return false;
|
|
@@ -3293,6 +3466,7 @@ exports.encryptAgilePackage = encryptAgilePackage;
|
|
|
3293
3466
|
exports.encryptOoxmlPackage = encryptOoxmlPackage;
|
|
3294
3467
|
exports.encryptStandardPackage = encryptStandardPackage;
|
|
3295
3468
|
exports.generateIV = generateIV;
|
|
3469
|
+
exports.inspectOoxmlEncryption = inspectOoxmlEncryption;
|
|
3296
3470
|
exports.isCompoundFile = isCompoundFile;
|
|
3297
3471
|
exports.isEncryptedOoxmlPackage = isEncryptedOoxmlPackage;
|
|
3298
3472
|
exports.isOoxmlCryptoError = isOoxmlCryptoError;
|
package/dist/crypto/index.d.ts
CHANGED
|
@@ -1,21 +1,36 @@
|
|
|
1
1
|
export { createOfficeGuid } from './uuid.js';
|
|
2
|
+
import { type DecryptOptions } from './decrypt.js';
|
|
2
3
|
import type { EncryptionOptions } from './types.js';
|
|
3
4
|
export { DataIntegrityError, IncorrectPasswordError, PasswordRequiredError, isOoxmlCryptoError, type OoxmlCryptoErrorCode, } from './errors.js';
|
|
4
5
|
export { EncryptedFileError, detectFileFormat, isCompoundFile, isEncryptedOoxmlPackage, openEncryptedPackage, type EncryptedPackageStreams, type FileFormatDetection, } from './detect.js';
|
|
5
6
|
export type { EncryptionAlgorithm, EncryptionInfo, EncryptionOptions, EncryptionScheme, StandardEncryptionInfo, } from './types.js';
|
|
6
7
|
export { RC4_ALG_ID, parseEncryptionInfo } from './encryption-info.js';
|
|
7
8
|
export { BLOCK_KEYS, computeStandardKeyBase, deriveAgileKey, deriveStandardKey, deriveStandardKeyFromBase, generateIV, } from './key-derivation.js';
|
|
8
|
-
export { decryptAgilePackage, decryptStandardPackage, verifyAgileDataIntegrity, verifyAgilePassword, verifyStandardPassword, } from './decrypt.js';
|
|
9
|
+
export { decryptAgilePackage, decryptStandardPackage, verifyAgileDataIntegrity, verifyAgilePassword, verifyStandardPassword, type DecryptOptions, } from './decrypt.js';
|
|
9
10
|
export { encryptAgilePackage, encryptStandardPackage } from './encrypt.js';
|
|
10
11
|
export { buildAgileEncryptionInfoXml, buildEncryptionInfoStream, buildStandardEncryptionInfoStream, } from './encryption-info-write.js';
|
|
11
12
|
/**
|
|
12
13
|
* Decrypts a password-protected OOXML package (agile or Standard encryption) to the plain zip.
|
|
13
14
|
*
|
|
14
15
|
* @throws IncorrectPasswordError (`code: 'incorrect-password'`) when the password is wrong.
|
|
15
|
-
* @throws DataIntegrityError (`code: 'data-integrity'`) when the agile HMAC does not match
|
|
16
|
+
* @throws DataIntegrityError (`code: 'data-integrity'`) when the agile HMAC does not match or
|
|
17
|
+
* is absent (pass `allowMissingIntegrity: true` to accept a package without one).
|
|
18
|
+
* Standard encryption has no integrity record at all: see {@link inspectOoxmlEncryption}.
|
|
16
19
|
* @throws Error when the bytes are not an encrypted package or the scheme is unsupported.
|
|
17
20
|
*/
|
|
18
|
-
export declare function decryptOoxmlPackage(input: Uint8Array | ArrayBuffer, password: string): Promise<Uint8Array>;
|
|
21
|
+
export declare function decryptOoxmlPackage(input: Uint8Array | ArrayBuffer, password: string, options?: DecryptOptions): Promise<Uint8Array>;
|
|
22
|
+
/** What an encrypted package offers, from {@link inspectOoxmlEncryption}. */
|
|
23
|
+
export interface OoxmlEncryptionSummary {
|
|
24
|
+
scheme: 'agile' | 'standard';
|
|
25
|
+
/**
|
|
26
|
+
* Whether the ciphertext is authenticated. False for Standard encryption (no HMAC exists in
|
|
27
|
+
* the scheme, so a decrypted package may have been modified) and for an agile package whose
|
|
28
|
+
* `dataIntegrity` was stripped.
|
|
29
|
+
*/
|
|
30
|
+
integrityProtected: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** The scheme of an encrypted package and whether it is integrity protected; no password needed. */
|
|
33
|
+
export declare function inspectOoxmlEncryption(input: Uint8Array | ArrayBuffer): OoxmlEncryptionSummary;
|
|
19
34
|
/**
|
|
20
35
|
* Encrypts an OOXML package (the zip bytes of a .xlsx, .docx, .pptx, ...) with a password to
|
|
21
36
|
* open. Writes the agile scheme (AES-256, SHA-512, 100,000 spins: what Office 2010+ writes) by
|
|
@@ -23,5 +38,5 @@ export declare function decryptOoxmlPackage(input: Uint8Array | ArrayBuffer, pas
|
|
|
23
38
|
*/
|
|
24
39
|
export declare function encryptOoxmlPackage(input: Uint8Array | ArrayBuffer, password: string, options?: EncryptionOptions): Promise<Uint8Array>;
|
|
25
40
|
/** Whether `password` opens the encrypted package, without decrypting it. Never throws. */
|
|
26
|
-
export declare function verifyOoxmlPackagePassword(input: Uint8Array | ArrayBuffer, password: string): Promise<boolean>;
|
|
41
|
+
export declare function verifyOoxmlPackagePassword(input: Uint8Array | ArrayBuffer, password: string, options?: DecryptOptions): Promise<boolean>;
|
|
27
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../crypto/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../crypto/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAMN,KAAK,cAAc,EACnB,MAAM,WAAW,CAAC;AAKnB,OAAO,KAAK,EAAkB,iBAAiB,EAA0B,MAAM,SAAS,CAAC;AAEzF,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,oBAAoB,GACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,GACxB,MAAM,UAAU,CAAC;AAClB,YAAY,EACX,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EACN,UAAU,EACV,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,KAAK,cAAc,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EACN,2BAA2B,EAC3B,yBAAyB,EACzB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAoBjC;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACxC,KAAK,EAAE,UAAU,GAAG,WAAW,EAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,cAAmB,GAC1B,OAAO,CAAC,UAAU,CAAC,CAYrB;AAED,6EAA6E;AAC7E,MAAM,WAAW,sBAAsB;IACtC,MAAM,EAAE,OAAO,GAAG,UAAU,CAAC;IAC7B;;;;OAIG;IACH,kBAAkB,EAAE,OAAO,CAAC;CAC5B;AAED,oGAAoG;AACpG,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,sBAAsB,CAI9F;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,UAAU,GAAG,WAAW,EAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,iBAAsB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAKrB;AAED,2FAA2F;AAC3F,wBAAsB,0BAA0B,CAC/C,KAAK,EAAE,UAAU,GAAG,WAAW,EAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,cAAmB,GAC1B,OAAO,CAAC,OAAO,CAAC,CAYlB"}
|