runtime/Stunnel.py
changeset 3848 91da73c3df61
parent 3750 f62625418bff
child 3884 34da877021d5
--- a/runtime/Stunnel.py	Thu Sep 28 18:28:07 2023 +0200
+++ b/runtime/Stunnel.py	Thu Sep 28 18:39:19 2023 +0200
@@ -1,7 +1,7 @@
 
 
 import os
-from binascii import b2a_hqx
+from binascii import b2a_base64
 try:
     from runtime.spawn_subprocess import call
 except ImportError:
@@ -25,9 +25,10 @@
 
 def PSKgen(ID, PSKpath):
 
-    # b2a_hqx output len is 4/3 input len
+    # secret string length is 256
+    # b2a_base64 output len is 4/3 input len
     secret = os.urandom(192)  # int(256/1.3333)
-    secretstring = b2a_hqx(secret)
+    secretstring = b2a_base64(secret)
 
     PSKstring = ID+":"+secretstring
     with open(PSKpath, 'w') as f: