mirror of
https://github.com/Leseratte10/acsm-calibre-plugin.git
synced 2024-12-22 17:29:56 +06:00
Fix nonce calculation bug (fixes #5)
This commit is contained in:
parent
8e8ca43c7e
commit
89dcaf75c1
@ -215,6 +215,8 @@ class ConfigWidget(QWidget):
|
||||
self.button_export_key.setEnabled(activated)
|
||||
self.button_export_activation.setEnabled(activated)
|
||||
|
||||
self.resize(self.sizeHint())
|
||||
|
||||
info_dialog(None, "Done", "Successfully imported authorization for " + ade_mail, show=True, show_copy_button=False)
|
||||
|
||||
|
||||
@ -270,6 +272,8 @@ class ConfigWidget(QWidget):
|
||||
self.button_export_key.setEnabled(True)
|
||||
self.button_export_activation.setEnabled(True)
|
||||
|
||||
self.resize(self.sizeHint())
|
||||
|
||||
info_dialog(None, "Done", "Authorized to account " + mail, show=True, show_copy_button=False)
|
||||
|
||||
|
||||
@ -293,7 +297,8 @@ class ConfigWidget(QWidget):
|
||||
|
||||
filters = [("DER Files", ["der"])]
|
||||
|
||||
filename = choose_save_file(self, "Export ADE keys", _("Export ADE keys"), filters, all_files=False)
|
||||
filename = choose_save_file(self, "Export ADE keys", _("Export ADE keys"), filters,
|
||||
all_files=False, initial_filename="adobe_encryption_key.der")
|
||||
|
||||
if (filename is None):
|
||||
return
|
||||
|
@ -274,15 +274,13 @@ def addNonce():
|
||||
usec = dt.microsecond
|
||||
sec = (dt - datetime(1970,1,1)).total_seconds()
|
||||
|
||||
nonce320 = int(0x6f046000)
|
||||
nonce321 = int(0x388a)
|
||||
bigtime = int(sec * 1000)
|
||||
|
||||
nonce320 += int((bigtime & 0xFFFFFFFF) + usec/1000)
|
||||
nonce321 += int(((bigtime >> 32) & 0xFFFFFFFF))
|
||||
Ntime = int(int(sec * 1000) + usec/1000)
|
||||
|
||||
final = bytearray(nonce320.to_bytes(4, 'little'))
|
||||
final.extend(nonce321.to_bytes(4, 'little'))
|
||||
# Unixtime to gregorian timestamp
|
||||
Ntime += 62167219200000
|
||||
|
||||
final = bytearray(Ntime.to_bytes(8, 'little'))
|
||||
tmp = 0
|
||||
final.extend(tmp.to_bytes(4, 'little'))
|
||||
|
||||
|
@ -547,7 +547,7 @@ def performFulfillmentNotification(fulfillmentResultToken, forceOptional = False
|
||||
critical = True
|
||||
|
||||
if element.get("critical", "yes") == "no":
|
||||
critial = False
|
||||
critical = False
|
||||
print("Notifying optional server %s" % (url))
|
||||
else:
|
||||
print("Notifying server %s" % (url))
|
||||
|
Loading…
Reference in New Issue
Block a user