diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx.rb | 6 | ||||
| -rw-r--r-- | lib/axlsx/util/cbf.rb | 4 | ||||
| -rw-r--r-- | lib/axlsx/util/ms_off_crypto.rb | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/axlsx.rb b/lib/axlsx.rb index 76f49fa4..d60a4aa8 100644 --- a/lib/axlsx.rb +++ b/lib/axlsx.rb @@ -6,9 +6,9 @@ require 'axlsx/version.rb' require 'axlsx/util/simple_typed_list.rb' require 'axlsx/util/constants.rb' require 'axlsx/util/validators.rb' -# require 'axlsx/util/storage.rb' -# require 'axlsx/util/cbf.rb' -# require 'axlsx/util/ms_off_crypto.rb' +require 'axlsx/util/storage.rb' +require 'axlsx/util/cbf.rb' +require 'axlsx/util/ms_off_crypto.rb' # to be included with parsable intitites. diff --git a/lib/axlsx/util/cbf.rb b/lib/axlsx/util/cbf.rb index 2f1ce37f..cff58f9d 100644 --- a/lib/axlsx/util/cbf.rb +++ b/lib/axlsx/util/cbf.rb @@ -139,8 +139,8 @@ module Axlsx @storages << Storage.new('TransformInfo', :color => Storage::COLORS[:red], :child=>9, :created=>129685612740834130, :modified=>129685612740943959) @storages << Storage.new('StrongEncryptionTransform', :child=>10, :created=>129685612740834169, :modified=>129685612740942280) @storages << primary - @storages << summary_information - @storages << document_summary_information + # @storages << summary_information + # @storages << document_summary_information # we do this at the end as we need to build the minifat stream to determine the size. #HOWEVER - it looks like the size should not include the padding? @storages.unshift Storage.new('Root Entry', :type=>Storage::TYPES[:root], :color=>Storage::COLORS[:red], :child=>1, :data => mini_fat_stream) diff --git a/lib/axlsx/util/ms_off_crypto.rb b/lib/axlsx/util/ms_off_crypto.rb index 57126ccd..32bbf53f 100644 --- a/lib/axlsx/util/ms_off_crypto.rb +++ b/lib/axlsx/util/ms_off_crypto.rb @@ -48,7 +48,7 @@ module Axlsx # encrypts and returns the package specified by the file name # @return [String] def encrypted_package - @encrypted_package ||= encrypt_package(file_name, password) + @encrypted_package ||= encrypt_package(file_name) end # returns the encryption info for this instance of ms-off-crypto @@ -94,10 +94,10 @@ module Axlsx end # size of unencrypted package? concated with encrypted package - def encrypt_package(file_name, password) + def encrypt_package(file_name) package = File.open(file_name, 'r') - package_text = package.read - [package_text.bytes.to_a.size].pack('q') + encrypt(package_text) + crypt_pack = encrypt(package.read) + [crypt_pack.size].pack('q') + crypt_pack end # Generates an encryption info structure |
