Skip to content

Commit f44486c

Browse files
committed
Fixes #4406.
1 parent b0d9c11 commit f44486c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/pure/net.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,6 @@ when defineSsl:
342342
result = SSLContext(context: newCTX, extraInternalIndex: 0,
343343
referencedData: initSet[int]())
344344
result.extraInternalIndex = getExtraDataIndex(result)
345-
# The PSK callback functions assume the internal index is 0.
346-
assert result.extraInternalIndex == 0
347345

348346
let extraInternal = new(SslContextExtraInternal)
349347
result.setExtraData(result.extraInternalIndex, extraInternal)
@@ -392,6 +390,8 @@ when defineSsl:
392390
##
393391
## Only used in PSK ciphersuites.
394392
ctx.getExtraInternal().clientGetPskFunc = fun
393+
assert ctx.extraInternalIndex == 0,
394+
"The pskClientCallback assumes the extraInternalIndex is 0"
395395
ctx.context.SSL_CTX_set_psk_client_callback(
396396
if fun == nil: nil else: pskClientCallback)
397397

0 commit comments

Comments
 (0)