Skip to content

Commit be3342d

Browse files
mtdcrsreichholf
authored andcommitted
webadmin: remove remnants of tpm check
1 parent 54d7e41 commit be3342d

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

webadmin/src/__init__.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1 @@
1-
import sha
2-
31
__version__ = "1.6.6"
4-
5-
def bin2long(s):
6-
return reduce( lambda x,y:(x<<8L)+y, map(ord, s))
7-
8-
def long2bin(l):
9-
res = ""
10-
for byte in range(128):
11-
res += chr((l >> (1024 - (byte + 1) * 8)) & 0xff)
12-
return res
13-
14-
def rsa_pub1024(src, mod):
15-
return long2bin(pow(bin2long(src), 65537, bin2long(mod)))
16-
17-
def decrypt_block(src, mod):
18-
if len(src) != 128 and len(src) != 202:
19-
return None
20-
dest = rsa_pub1024(src[:128], mod)
21-
hash = sha.new(dest[1:107])
22-
if len(src) == 202:
23-
hash.update(src[131:192])
24-
result = hash.digest()
25-
if result == dest[107:127]:
26-
return dest
27-
return None
28-

0 commit comments

Comments
 (0)