Skip to content

feat: remove secio support #7943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/seccat/.gitignore

This file was deleted.

255 changes: 0 additions & 255 deletions cmd/seccat/seccat.go

This file was deleted.

8 changes: 0 additions & 8 deletions cmd/seccat/seccat_plan9.go

This file was deleted.

10 changes: 0 additions & 10 deletions cmd/seccat/seccat_posix.go

This file was deleted.

47 changes: 0 additions & 47 deletions cmd/seccat/util.go

This file was deleted.

14 changes: 9 additions & 5 deletions core/node/libp2p/sec.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import (
config "github.com/ipfs/go-ipfs-config"
"github.com/libp2p/go-libp2p"
noise "github.com/libp2p/go-libp2p-noise"
secio "github.com/libp2p/go-libp2p-secio"
tls "github.com/libp2p/go-libp2p-tls"
)

const secioEnabledWarning = `The SECIO security transport was enabled in the config but is no longer supported.

SECIO disabled by default in go-ipfs 0.7 removed in go-ipfs 0.9. Please remove
Swarm.Transports.Security.SECIO from your IPFS config.`

func Security(enabled bool, tptConfig config.Transports) interface{} {
if !enabled {
return func() (opts Libp2pOpts) {
Expand All @@ -18,16 +22,16 @@ func Security(enabled bool, tptConfig config.Transports) interface{} {
}
}

if _, enabled := tptConfig.Security.SECIO.WithDefault(config.Disabled); enabled {
log.Error(secioEnabledWarning)
}

// Using the new config options.
return func() (opts Libp2pOpts) {
opts.Opts = append(opts.Opts, prioritizeOptions([]priorityOption{{
priority: tptConfig.Security.TLS,
defaultPriority: 100,
opt: libp2p.Security(tls.ID, tls.New),
}, {
priority: tptConfig.Security.SECIO,
defaultPriority: config.Disabled,
opt: libp2p.Security(secio.ID, secio.New),
}, {
priority: tptConfig.Security.Noise,
defaultPriority: 300,
Expand Down
12 changes: 2 additions & 10 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -1352,8 +1352,7 @@ receiver supports. When establishing an _inbound_ connection, go-ipfs will let
the initiator choose the protocol, but will refuse to use any of the disabled
transports.

Supported transports are: TLS (priority 100), SECIO (Disabled: i.e. priority false), Noise
(priority 300).
Supported transports are: TLS (priority 100) and Noise (priority 300).

No default priority will ever be less than 100.

Expand All @@ -1369,14 +1368,7 @@ Type: `priority`

#### `Swarm.Transports.Security.SECIO`

[SECIO](https://github.com/libp2p/specs/tree/master/secio) was the most widely
supported IPFS & libp2p security transport. However, it is currently being
phased out in favor of more popular and better vetted protocols like TLS and
Noise.

Default: `false`

Type: `priority`
Support for SECIO has been removed. Please remove this option from your config.

#### `Swarm.Transports.Security.Noise`

Expand Down
Loading