Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Sep 27, 2022
1 parent d9d9f43 commit ab8da66
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 32 deletions.
2 changes: 1 addition & 1 deletion NOnion/Cells/CellAuthChallenge.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type CellAuthChallenge =
methods
else
readMethod
(methods @ [ ReadBigEndianUInt16 reader ])
(ReadBigEndianUInt16 reader :: methods)
(remainingCount - 1)

let challenge = reader.ReadBytes Constants.ChallangeLength
Expand Down
2 changes: 1 addition & 1 deletion NOnion/Cells/CellCerts.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type CellCerts =
}

readCertificates
(certificates @ [ certificate ])
(certificate :: certificates)
(remainingCount - 1)

let certificatesCount = reader.ReadByte() |> int
Expand Down
2 changes: 1 addition & 1 deletion NOnion/Cells/CellVersions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type CellVersions =
if reader.BaseStream.Length = reader.BaseStream.Position then
versions
else
readVersions(versions @ [ ReadBigEndianUInt16 reader ])
readVersions((ReadBigEndianUInt16 reader) :: versions)

let versions = readVersions List.empty

Expand Down
6 changes: 2 additions & 4 deletions NOnion/Cells/Relay/RelayIntroduce.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ type RelayIntroduceInnerData =
state
else
readExtensionsList
(state
@ List.singleton(RelayIntroExtension.FromBytes reader))
((RelayIntroExtension.FromBytes reader) :: state)
(remainingCount - 1uy)

readExtensionsList List.empty extensionCount
Expand Down Expand Up @@ -105,8 +104,7 @@ type RelayIntroduce =
state
else
readExtensionsList
(state
@ List.singleton(RelayIntroExtension.FromBytes reader))
((RelayIntroExtension.FromBytes reader)::state)
(remainingCount - 1uy)

readExtensionsList List.empty extensionCount
Expand Down
3 changes: 1 addition & 2 deletions NOnion/Cells/Relay/RelayIntroduceAck.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ type RelayIntroduceAck =
state
else
readExtensionsList
(state
@ List.singleton(RelayIntroExtension.FromBytes reader))
(((RelayIntroExtension.FromBytes reader)) :: state)
(remainingCount - 1uy)

readExtensionsList List.empty extensionCount
Expand Down
40 changes: 18 additions & 22 deletions NOnion/Network/TorCircuit.fs
Original file line number Diff line number Diff line change
Expand Up @@ -673,17 +673,15 @@ type TorCircuit
circuitState <-
Ready(
circuitId,
nodes
@ List.singleton
{
TorCircuitNode.CryptoState =
TorCryptoState.FromKdfResult
(Kdf.ComputeHSKdf ntorKeySeed)
true
Window =
TorWindow
Constants.DefaultCircuitLevelWindowParams
}
{
TorCircuitNode.CryptoState =
TorCryptoState.FromKdfResult
(Kdf.ComputeHSKdf ntorKeySeed)
true
Window =
TorWindow
Constants.DefaultCircuitLevelWindowParams
} :: nodes
)

do!
Expand Down Expand Up @@ -785,17 +783,15 @@ type TorCircuit
circuitState <-
Ready(
circuitId,
nodes
@ List.singleton
{
TorCircuitNode.CryptoState =
TorCryptoState.FromKdfResult
kdfResult
false
Window =
TorWindow
Constants.DefaultCircuitLevelWindowParams
}
{
TorCircuitNode.CryptoState =
TorCryptoState.FromKdfResult
kdfResult
false
Window =
TorWindow
Constants.DefaultCircuitLevelWindowParams
} :: nodes
)

tcs.SetResult circuitId
Expand Down
2 changes: 1 addition & 1 deletion NOnion/Utility/Base32Util.fs
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ module Base32Util =
tail
| _ -> result

[ for c in text -> c ] |> parse [] |> List.toArray
[ for c in text -> c ] |> parse List.Empty |> List.toArray

0 comments on commit ab8da66

Please sign in to comment.