Skip to content

Commit

Permalink
Fixes #4406.
Browse files Browse the repository at this point in the history
  • Loading branch information
dom96 committed Aug 13, 2016
1 parent b0d9c11 commit f44486c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pure/net.nim
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,6 @@ when defineSsl:
result = SSLContext(context: newCTX, extraInternalIndex: 0,
referencedData: initSet[int]())
result.extraInternalIndex = getExtraDataIndex(result)
# The PSK callback functions assume the internal index is 0.
assert result.extraInternalIndex == 0

let extraInternal = new(SslContextExtraInternal)
result.setExtraData(result.extraInternalIndex, extraInternal)
Expand Down Expand Up @@ -392,6 +390,8 @@ when defineSsl:
##
## Only used in PSK ciphersuites.
ctx.getExtraInternal().clientGetPskFunc = fun
assert ctx.extraInternalIndex == 0,
"The pskClientCallback assumes the extraInternalIndex is 0"
ctx.context.SSL_CTX_set_psk_client_callback(
if fun == nil: nil else: pskClientCallback)

Expand Down

0 comments on commit f44486c

Please sign in to comment.