Skip to content

Commit d1e51be

Browse files
authored
Remove secio (#1072)
1 parent 275d649 commit d1e51be

File tree

5 files changed

+5
-548
lines changed

5 files changed

+5
-548
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ List of packages modules implemented in nim-libp2p:
7171
| [libp2p-ws](libp2p/transports/wstransport.nim) | WebSocket & WebSocket Secure transport |
7272
| [libp2p-tor](libp2p/transports/tortransport.nim) | Tor Transport |
7373
| **Secure Channels** | |
74-
| [libp2p-secio](libp2p/protocols/secure/secio.nim) | Secio secure channel |
7574
| [libp2p-noise](libp2p/protocols/secure/noise.nim) | [Noise](https://docs.libp2p.io/concepts/secure-comm/noise/) secure channel |
7675
| [libp2p-plaintext](libp2p/protocols/secure/plaintext.nim) | Plain Text for development purposes |
7776
| **Stream Multiplexers** | |

libp2p/builders.nim

+1-7
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ type
3636
TransportProvider* {.public.} = proc(upgr: Upgrade): Transport {.gcsafe, raises: [].}
3737

3838
SecureProtocol* {.pure.} = enum
39-
Noise,
40-
Secio {.deprecated.}
39+
Noise
4140

4241
SwitchBuilder* = ref object
4342
privKey: Option[PrivateKey]
@@ -310,11 +309,6 @@ proc newStandardSwitch*(
310309
peerStoreCapacity = 1000
311310
): Switch {.raises: [LPError], public.} =
312311
## Helper for common switch configurations.
313-
{.push warning[Deprecated]:off.}
314-
if SecureProtocol.Secio in secureManagers:
315-
quit("Secio is deprecated!") # use of secio is unsafe
316-
{.pop.}
317-
318312
let addrs = when addrs is MultiAddress: @[addrs] else: addrs
319313
var b = SwitchBuilder
320314
.new()

libp2p/crypto/crypto.nim

-53
Original file line numberDiff line numberDiff line change
@@ -924,59 +924,6 @@ proc selectBest*(order: int, p1, p2: string): string =
924924
if felement == selement:
925925
return felement
926926

927-
proc createProposal*(nonce, pubkey: openArray[byte],
928-
exchanges, ciphers, hashes: string): seq[byte] =
929-
## Create SecIO proposal message using random ``nonce``, local public key
930-
## ``pubkey``, comma-delimieted list of supported exchange schemes
931-
## ``exchanges``, comma-delimeted list of supported ciphers ``ciphers`` and
932-
## comma-delimeted list of supported hashes ``hashes``.
933-
var msg = initProtoBuffer({WithUint32BeLength})
934-
msg.write(1, nonce)
935-
msg.write(2, pubkey)
936-
msg.write(3, exchanges)
937-
msg.write(4, ciphers)
938-
msg.write(5, hashes)
939-
msg.finish()
940-
msg.buffer
941-
942-
proc decodeProposal*(message: seq[byte], nonce, pubkey: var seq[byte],
943-
exchanges, ciphers, hashes: var string): bool =
944-
## Parse incoming proposal message and decode remote random nonce ``nonce``,
945-
## remote public key ``pubkey``, comma-delimieted list of supported exchange
946-
## schemes ``exchanges``, comma-delimeted list of supported ciphers
947-
## ``ciphers`` and comma-delimeted list of supported hashes ``hashes``.
948-
##
949-
## Procedure returns ``true`` on success and ``false`` on error.
950-
var pb = initProtoBuffer(message)
951-
let r1 = pb.getField(1, nonce)
952-
let r2 = pb.getField(2, pubkey)
953-
let r3 = pb.getField(3, exchanges)
954-
let r4 = pb.getField(4, ciphers)
955-
let r5 = pb.getField(5, hashes)
956-
957-
r1.get(false) and r2.get(false) and r3.get(false) and
958-
r4.get(false) and r5.get(false)
959-
960-
proc createExchange*(epubkey, signature: openArray[byte]): seq[byte] =
961-
## Create SecIO exchange message using ephemeral public key ``epubkey`` and
962-
## signature of proposal blocks ``signature``.
963-
var msg = initProtoBuffer({WithUint32BeLength})
964-
msg.write(1, epubkey)
965-
msg.write(2, signature)
966-
msg.finish()
967-
msg.buffer
968-
969-
proc decodeExchange*(message: seq[byte],
970-
pubkey, signature: var seq[byte]): bool =
971-
## Parse incoming exchange message and decode remote ephemeral public key
972-
## ``pubkey`` and signature ``signature``.
973-
##
974-
## Procedure returns ``true`` on success and ``false`` on error.
975-
var pb = initProtoBuffer(message)
976-
let r1 = pb.getField(1, pubkey)
977-
let r2 = pb.getField(2, signature)
978-
r1.get(false) and r2.get(false)
979-
980927
## Serialization/Deserialization helpers
981928

982929
proc write*(vb: var VBuffer, pubkey: PublicKey) {.

0 commit comments

Comments
 (0)