Commit ae2ccf9
committed
Avoid password prompt when only encrypted attachments exist
PDF.js wrongly prompted for passwords when a PDF had no attachments but
had an encryption enabled that was limited to only attachments
leaving all page, image and metadata streams in clear text.
The encryption dictionary is now discarded for this case.
This prevents unnecessary prompts for PDFs with no protected
content beyond attachments1 parent e5922f2 commit ae2ccf9
File tree
4 files changed
+70
-16
lines changed- src/core
- test
- pdfs
- unit
4 files changed
+70
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | 122 | | |
138 | 123 | | |
139 | 124 | | |
| |||
143 | 128 | | |
144 | 129 | | |
145 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
146 | 176 | | |
147 | 177 | | |
148 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8751 | 8751 | | |
8752 | 8752 | | |
8753 | 8753 | | |
| 8754 | + | |
| 8755 | + | |
| 8756 | + | |
| 8757 | + | |
| 8758 | + | |
| 8759 | + | |
| 8760 | + | |
| 8761 | + | |
8754 | 8762 | | |
8755 | 8763 | | |
8756 | 8764 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
878 | 878 | | |
879 | 879 | | |
880 | 880 | | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
881 | 896 | | |
882 | 897 | | |
883 | 898 | | |
| |||
0 commit comments