173 Commits

Author SHA1 Message Date
Denys Smirnov
7f8c6b65ae security: optimize alg2 function for R=4 2018-11-07 22:08:54 +02:00
Denys Smirnov
7521c7cee4 security: simplify paddedPass function for R=4 2018-11-07 22:08:54 +02:00
Denys Smirnov
95ec848145 security: validate input parameters and return proper errors 2018-11-07 22:08:54 +02:00
Gunnsteinn Hall
8007138bd3 Addressing PR 238 review comments 2018-10-23 11:43:02 +00:00
Gunnsteinn Hall
3454ec67dc Merge branch 'v3' into v3-enhance-forms 2018-10-13 11:32:20 +00:00
Samuel Melrose
7a641b09d2 Add Comments for Expose PDF Version #230 2018-10-09 10:40:02 +00:00
Denys Smirnov
5d09fa8cde crypt: handle length format violation for length=40 2018-10-08 18:35:33 +03:00
Samuel Melrose
d3cc236351 Expose PDF Version #230 2018-10-08 10:27:39 +00:00
Denys Smirnov
84284c88ec security: add missing license headers, more documentation 2018-10-08 01:04:56 +03:00
Denys Smirnov
7bd4ba688d core: split crypt filter methods into a separate package 2018-10-08 00:18:18 +03:00
Denys Smirnov
42df346e69 core: split security handlers into a separate package 2018-10-08 00:18:18 +03:00
Denys Smirnov
006e5f9e6e core: simplify decoding of Encrypt dictionary a bit with a helper 2018-10-08 00:18:18 +03:00
Denys Smirnov
68d20968d3 core: move encryption dictionary encoder and decoder to it's own type 2018-10-08 00:18:18 +03:00
Denys Smirnov
1c19ba9e96 core: decouple security handlers with different revisions from PdfCrypt 2018-10-08 00:18:18 +03:00
Denys Smirnov
7e9f3dd7e2 core: unexport remaining PdfCrypt methods 2018-10-08 00:18:18 +03:00
Denys Smirnov
fd9b3746de core: unexport remaining PdfCrypt fields 2018-10-08 00:18:18 +03:00
Denys Smirnov
bccaa87cdc core: refactor encryption and decryption types 2018-10-08 00:18:18 +03:00
Denys Smirnov
b5288e7ddc core: change permissions type to a bitmask 2018-10-08 00:18:18 +03:00
Denys Smirnov
ef64bef191 core: permissions field is uint32 according to the spec 2018-10-08 00:18:18 +03:00
Gunnsteinn Hall
3536d323fb Support MK appearance characteristics for certain styles. Wrap content stream to fix bugs. 2018-10-05 01:59:19 +00:00
Aleksei Pavliukov
ea5dba8e0d Implemented : PDFs optimization 2018-09-30 01:01:31 +03:00
Gunnsteinn Hall
aea91f1ba9 Merge branch 'v3' into v3-enhance-forms 2018-09-29 16:59:16 +00:00
Gunnsteinn Hall
55bbc5c2ca Add function to make UTF16-BE encoded PdfObjectString - core.MakeEncodedString 2018-09-29 02:23:38 +00:00
Denys Smirnov
418b99b4d8 core: detect old copies of Encrypt dictionary; fix #215 2018-09-29 00:16:57 +03:00
Gunnsteinn Hall
e99b037340 PDFDocEncoding tests 2018-09-28 09:50:18 +00:00
Gunnsteinn Hall
6ec59ca86c Returnnot found when *PdfObjectInteger is nil 2018-09-28 09:50:04 +00:00
Denys Smirnov
d73bd8d1d2 core: correctly handle encryption of xref streams and trailer fields 2018-09-26 04:54:00 +03:00
Gunnsteinn Hall
6cafab4121 Merge branch 'master' into v3 2018-09-25 23:37:11 +00:00
Denys Smirnov
760f58b954 core: add doc comments for CFMs 2018-09-26 02:16:17 +03:00
Denys Smirnov
4b01f8f6ae update code after merge with master 2018-09-26 01:46:13 +03:00
Denys Smirnov
acd4308d56 Merge branch 'refactor' into v3
# Conflicts:
#	pdf/core/crypt.go
#	pdf/model/writer.go
2018-09-26 01:08:19 +03:00
Denys Smirnov
b3c45a550a core: refactor crypt filter selection code 2018-09-26 00:52:05 +03:00
Denys Smirnov
d551451585 core: move common code for object key generation to a separate function 2018-09-26 00:52:05 +03:00
Denys Smirnov
be03592b2a core: move CFM to separate structs that implement a common interface 2018-09-26 00:52:05 +03:00
Denys Smirnov
7b2f6a6aab core: do not decrypt XRef streams and the Encrypt dictionary; fix #205 2018-09-25 01:48:29 +03:00
Denys Smirnov
8450ebcef6 core: use type switch instead of if statements in encode and decode 2018-09-20 02:00:01 +03:00
Denys Smirnov
b7dcbc22de core: fix standard crypt filter name; resolves issues with Adobe Reader 2018-09-19 23:48:50 +03:00
Denys Smirnov
eac1e899dc core: allow to write documents with AES encryption 2018-09-19 06:02:15 +03:00
Denys Smirnov
839f9ea3bc core: fix padding for AESv3 2018-09-19 06:01:29 +03:00
Denys Smirnov
d424bc2b6d core: add MakeBool helper 2018-09-19 06:00:19 +03:00
Denys Smirnov
d4b2490ea3 core: implement encryption algorithms 8-10; add tests for alg 8-13 2018-09-19 03:33:59 +03:00
Denys Smirnov
7fb4c91137 core: do not overwrite Perms then validating it 2018-09-19 03:12:49 +03:00
Denys Smirnov
e18e4b502c core: move zero iv allocation to a separate function 2018-09-19 02:44:26 +03:00
Denys Smirnov
1371f91098 core: check metadata encryption flag in alg13 2018-09-19 02:43:32 +03:00
Denys Smirnov
c7cfde7c1f core: move test data, add docs and link to the specification 2018-09-17 17:36:31 +03:00
Gunnsteinn Hall
9efa91168d Fix for building acroform ToPdfObject 2018-09-16 17:56:03 +00:00
Denys Smirnov
c08a13c234 core: optimize allocations for hash used in R=6 2018-09-16 17:10:04 +03:00
Denys Smirnov
6e2c1c51bf core: add a test case for files with a very long password 2018-09-16 15:31:02 +03:00
Denys Smirnov
8f4f1804b0 core: implement decoding of AESv3; resolves #30 2018-09-16 04:13:24 +03:00
Denys Smirnov
6510d0a853 core: algorithms 2a and 13 (decode file key and validate permissions) 2018-09-16 02:48:08 +03:00