From 853fd9d07501616f81e2161eacb547b262274eb3 Mon Sep 17 00:00:00 2001 From: espinosa Date: Sat, 5 Jun 2021 10:32:02 +0200 Subject: [PATCH] lightkey support --- nomorepass/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nomorepass/core.py b/nomorepass/core.py index 997b488..93a6259 100644 --- a/nomorepass/core.py +++ b/nomorepass/core.py @@ -98,7 +98,13 @@ def getQrNomorekeys (self,site, user, password, type, extra): tk = nmp_newtoken() self.token = tk self.ticket = response["ticket"] - password = password[:14].ljust(14) + if (type=='soundkey'): + password = password[:14].ljust(14) + else: + #lightkeys son un solo entero, la clave ha de ser + #un numero de 0 a 65536 (unsigned) por lo que + #hacemos el resto y volvemos a pasar a cadena + password = str(int(password)%65536) ep = nmp_encrypt(password,tk) if (isinstance(extra,dict)): if 'extra' in extra.keys():