Delete client private key from memory after key exchange.
This commit is contained in:
@@ -46,7 +46,7 @@ proc main(ip: string = "localhost", port: int = 37573) =
|
|||||||
let io = igGetIO()
|
let io = igGetIO()
|
||||||
|
|
||||||
# Create key pair
|
# Create key pair
|
||||||
let clientKeyPair = generateKeyPair()
|
var clientKeyPair = generateKeyPair()
|
||||||
|
|
||||||
# Initiate WebSocket connection
|
# Initiate WebSocket connection
|
||||||
var connection = WsConnection(
|
var connection = WsConnection(
|
||||||
@@ -79,6 +79,7 @@ proc main(ip: string = "localhost", port: int = 37573) =
|
|||||||
of CLIENT_KEY_EXCHANGE:
|
of CLIENT_KEY_EXCHANGE:
|
||||||
connection.sessionKey = deriveSessionKey(clientKeyPair, decode(event.data["publicKey"].getStr()).toKey())
|
connection.sessionKey = deriveSessionKey(clientKeyPair, decode(event.data["publicKey"].getStr()).toKey())
|
||||||
connection.sendPublicKey(clientKeyPair.publicKey)
|
connection.sendPublicKey(clientKeyPair.publicKey)
|
||||||
|
wipeKey(clientKeyPair.privateKey)
|
||||||
|
|
||||||
of CLIENT_PROFILE:
|
of CLIENT_PROFILE:
|
||||||
profile = parsetoml.parseString(event.data["profile"].getStr())
|
profile = parsetoml.parseString(event.data["profile"].getStr())
|
||||||
@@ -169,8 +170,6 @@ proc main(ip: string = "localhost", port: int = 37573) =
|
|||||||
except IOError:
|
except IOError:
|
||||||
discard
|
discard
|
||||||
|
|
||||||
discard
|
|
||||||
|
|
||||||
else: discard
|
else: discard
|
||||||
|
|
||||||
# Draw/update UI components/views
|
# Draw/update UI components/views
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ const CONQUEST_ROOT* {.strdefine.} = ""
|
|||||||
|
|
||||||
const WIDGET_SESSIONS* = " " & ICON_FA_LIST & " " & "Sessions [Table View]"
|
const WIDGET_SESSIONS* = " " & ICON_FA_LIST & " " & "Sessions [Table View]"
|
||||||
const WIDGET_LISTENERS* = " " & ICON_FA_SATELLITE_DISH & " " & "Listeners"
|
const WIDGET_LISTENERS* = " " & ICON_FA_SATELLITE_DISH & " " & "Listeners"
|
||||||
const WIDGET_EVENTLOG* = "Eventlog"
|
const WIDGET_EVENTLOG* = " " & ICON_FA_CLIPBOARD_LIST & " " & "Eventlog"
|
||||||
const WIDGET_DOWNLOADS* = " " & ICON_FA_DOWNLOAD & " " & "Downloads"
|
const WIDGET_DOWNLOADS* = " " & ICON_FA_DOWNLOAD & " " & "Downloads"
|
||||||
const WIDGET_SCREENSHOTS* = " " & ICON_FA_IMAGE & " " & "Screenshots"
|
const WIDGET_SCREENSHOTS* = " " & ICON_FA_IMAGE & " " & "Screenshots"
|
||||||
|
|||||||
@@ -13,12 +13,10 @@ type
|
|||||||
# Text highlighting
|
# Text highlighting
|
||||||
proc getText(item: ConsoleItem): cstring =
|
proc getText(item: ConsoleItem): cstring =
|
||||||
if item.itemType != LOG_OUTPUT:
|
if item.itemType != LOG_OUTPUT:
|
||||||
# let timestamp = item.timestamp.fromUnix().format("dd-MM-yyyy HH:mm:ss")
|
|
||||||
return "[" & item.timestamp & "]" & $item.itemType & item.text
|
return "[" & item.timestamp & "]" & $item.itemType & item.text
|
||||||
else:
|
else:
|
||||||
return $item.itemType & item.text
|
return $item.itemType & item.text
|
||||||
|
|
||||||
|
|
||||||
proc getNumLines(data: pointer): csize_t {.cdecl.} =
|
proc getNumLines(data: pointer): csize_t {.cdecl.} =
|
||||||
if data.isNil:
|
if data.isNil:
|
||||||
return 0
|
return 0
|
||||||
@@ -92,10 +90,10 @@ proc draw*(component: TextareaWidget, size: ImVec2, filter: ptr ImGuiTextFilter
|
|||||||
let childWindowFlags = ImGuiChildFlags_NavFlattened.int32 or ImGui_ChildFlags_Borders.int32 or ImGui_ChildFlags_AlwaysUseWindowPadding.int32 or ImGuiChildFlags_FrameStyle.int32
|
let childWindowFlags = ImGuiChildFlags_NavFlattened.int32 or ImGui_ChildFlags_Borders.int32 or ImGui_ChildFlags_AlwaysUseWindowPadding.int32 or ImGuiChildFlags_FrameStyle.int32
|
||||||
if igBeginChild_Str("##TextArea", size, childWindowFlags, ImGuiWindowFlags_HorizontalScrollbar.int32):
|
if igBeginChild_Str("##TextArea", size, childWindowFlags, ImGuiWindowFlags_HorizontalScrollbar.int32):
|
||||||
|
|
||||||
component.contentDisplayed.items.setLen(0)
|
|
||||||
|
|
||||||
# Display items
|
# Display items
|
||||||
|
component.contentDisplayed.items.setLen(0)
|
||||||
for item in component.content.items:
|
for item in component.content.items:
|
||||||
|
|
||||||
# Handle search/filter
|
# Handle search/filter
|
||||||
if not filter.isNil():
|
if not filter.isNil():
|
||||||
if filter.ImGuiTextFilter_IsActive():
|
if filter.ImGuiTextFilter_IsActive():
|
||||||
@@ -111,7 +109,7 @@ proc draw*(component: TextareaWidget, size: ImVec2, filter: ptr ImGuiTextFilter
|
|||||||
component.textSelect.textselect_update()
|
component.textSelect.textselect_update()
|
||||||
|
|
||||||
except IndexDefect:
|
except IndexDefect:
|
||||||
# CTRL+A crashes when no items are in the eventlog
|
# CTRL+A crashes when no items are in the text area
|
||||||
discard
|
discard
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
Reference in New Issue
Block a user