Skip to content
This repository was archived by the owner on Mar 29, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions db_packer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import lzma
from Crypto.Hash import SHA384
from Crypto.PublicKey import RSA
from Crypto.Signature import pkcs1_15
from Crypto.Signature import pss

# args
folder = ""
Expand Down Expand Up @@ -165,7 +165,7 @@ def should_skip_file(filename):
comp_sum = SHA384.new(compressed).hexdigest()
if ".dll" in dbpath or ".so" in dbpath or ".cfg" in dbpath:
print("Signing...")
signature = pkcs1_15.new(key).sign(sign_sum)
signature = pss.new(key).sign(sign_sum)
else:
signature = None
c.execute('INSERT INTO files VALUES (?,?,?,?,?)', (dbpath, 0, new_sum, comp_sum,signature))
Expand All @@ -185,7 +185,7 @@ def should_skip_file(filename):
comp_sum = SHA384.new(compressed).hexdigest()
if ".dll" in dbpath or ".so" in dbpath or ".cfg" in dbpath:
print("Updating signature...")
signature = pkcs1_15.new(key).sign(sign_sum)
signature = pss.new(key).sign(sign_sum)
else:
signature = None
c.execute('UPDATE files SET revision=revision+1 WHERE path=?', (dbpath,))
Expand All @@ -207,7 +207,7 @@ def should_skip_file(filename):
conn.close()
db = open(targetFolder+"/ofmanifest.db",'rb')
dbr = db.read()
dbsum = pkcs1_15.new(key).sign(SHA384.new(dbr))
dbsum = pss.new(key).sign(SHA384.new(dbr))
db.close()
ds = open(targetFolder+"/ofmanifest.sig",'wb')
ds.write(dbsum)
Expand Down