File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,26 @@ def process_file(filename):
46
46
elements = list (r .getiterator ())
47
47
48
48
is_encrypted = False
49
+ is_supported = True
49
50
key_size = 16
50
51
start_key_generation_name = "SHA1"
52
+
53
+ for element in elements :
54
+ if element .get ("{urn:oasis:names:tc:opendocument:xmlns:manifest:1.0}full-path" ) == "encrypted-package" :
55
+ is_supported = False
56
+
57
+ if element .get ("{urn:oasis:names:tc:opendocument:xmlns:manifest:1.0}key-derivation-name" ) is not None :
58
+ key_derivation_name = element .get ("{urn:oasis:names:tc:opendocument:xmlns:manifest:1.0}key-derivation-name" )
59
+
60
+ if element .get ("{urn:oasis:names:tc:opendocument:xmlns:manifest:1.0}algorithm-name" ) is not None :
61
+ algorithm_name = element .get ("{urn:oasis:names:tc:opendocument:xmlns:manifest:1.0}algorithm-name" )
62
+
63
+ if not is_supported :
64
+ sys .stderr .write ("%s is an unsupported encrypted OpenOffice file!\n " % filename )
65
+ sys .stderr .write ("- Algorithm name: '%s';\n " % algorithm_name )
66
+ sys .stderr .write ("- Key derivation name: '%s'.\n " % key_derivation_name )
67
+ return 14
68
+
51
69
for i in range (0 , len (elements ) - 4 ):
52
70
element = elements [i ]
53
71
if element .get ("{urn:oasis:names:tc:opendocument:xmlns:manifest:1.0}full-path" ) == "content.xml" :
You can’t perform that action at this time.
0 commit comments