beremiz
Clone
Summary
Browse
Changes
Graph
Addapt to Py3.11.5 in Stunnel.py
2023-09-28, Edouard Tisserant
91da73c3df61
Parents
832c257d5618
Children
c3f4e114af38
Addapt to Py3.11.5 in Stunnel.py
b2a_hqx is now deprecated, base64 should bring comparable results
1 files changed, 4 insertions(+), 3 deletions(-)
+4
-3
runtime/Stunnel.py
--- 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: