File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 17
17
# PSK wrapper function for SSL connection
18
18
def psk_wrapper (sock ):
19
19
# Pre-Shared Key (PSK) and PSK Identity
20
- psk = b '608b0a0049d41fdb35a824ef0a227f24e5099c60aa935e803370a961c937d6f7'
20
+ psk = bytes . fromhex ( '608b0a0049d41fdb35a824ef0a227f24e5099c60aa935e803370a961c937d6f7' )
21
21
psk_identity = b'PSKID'
22
22
23
23
# Wrap the socket using sslpsk to establish an SSL connection with PSK
Original file line number Diff line number Diff line change 17
17
# PSK wrapper function for SSL connection
18
18
def psk_wrapper (sock , tls ):
19
19
# Pre-Shared Key (PSK) and PSK Identity
20
- psk = b '608b0a0049d41fdb35a824ef0a227f24e5099c60aa935e803370a961c937d6f7'
20
+ psk = bytes . fromhex ( '608b0a0049d41fdb35a824ef0a227f24e5099c60aa935e803370a961c937d6f7' )
21
21
psk_identity = b'PSKID'
22
22
23
23
return sslpsk .wrap_socket (
Original file line number Diff line number Diff line change 15
15
16
16
17
17
# PSK wrapper function for SSL connection
18
- def psk_wrapper (sock , tls ):
18
+ def psk_wrapper (sock , config ):
19
19
psk = None
20
- psk_identity = tls .get ('tlspskidentity' )
21
- psk_file = tls .get ('tlspskfile' )
20
+ psk_identity = config .get ('tlspskidentity' ). encode ( 'utf-8 ' )
21
+ psk_file = config .get ('tlspskfile' )
22
22
23
23
# Read PSK from file if specified
24
24
if psk_file :
25
25
with open (psk_file , encoding = 'utf-8' ) as f :
26
- psk = f .read ()
26
+ psk = bytes . fromhex ( f .read () )
27
27
28
28
# Check if both PSK and PSK identity are available
29
29
if psk and psk_identity :
You can’t perform that action at this time.
0 commit comments