diff options
| author | Randy Morgan <[email protected]> | 2012-02-07 20:17:46 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-02-07 20:17:46 +0900 |
| commit | 6272d7bc63ee05b6793d034461af3ee811ffe72a (patch) | |
| tree | 314258b56a0dcc21f4b26c51f8c00fa0dabb2afa /lib | |
| parent | ec9ddc5137b04a5fa96c7ea65a67df3bd6069167 (diff) | |
| download | caxlsx-6272d7bc63ee05b6793d034461af3ee811ffe72a.tar.gz caxlsx-6272d7bc63ee05b6793d034461af3ee811ffe72a.zip | |
current ms_off_crypto - needs to be re-written to use agile encryption..
gotta love that documentation - thanks MS - *really* clear....
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 |
