Index: xarfile.py |
=================================================================== |
--- a/xarfile.py |
+++ b/xarfile.py |
@@ -4,17 +4,16 @@ |
import re |
import struct |
import time |
import zlib |
from Crypto.Hash import SHA |
from Crypto.PublicKey import RSA |
-from Crypto.Signature import PKCS1_v1_5 |
from buildtools.packager import getTemplate |
XAR_HEADER = struct.Struct('>IHHQQI') |
XAR_HEADER_MAGIC = 0x78617221 |
XAR_VERSION = 1 |
XAR_CKSUM_SHA1 = 1 |
@@ -41,16 +40,18 @@ def get_checksum(data): |
return SHA.new(data).digest() |
def get_hexchecksum(data): |
return SHA.new(data).hexdigest() |
def get_signature(key, data): |
+ from Crypto.Signature import PKCS1_v1_5 |
+ |
return PKCS1_v1_5.new(key).sign(SHA.new(data)) |
def compress_files(filedata, root, offset): |
compressed_data = [] |
filedata = sorted(filedata.iteritems()) |
directory_stack = [('', root)] |
file_id = 1 |