Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

accept a PSK in the transport constructor (and reject it) #111

Merged
merged 1 commit into from Mar 7, 2020

Conversation

marten-seemann
Copy link
Collaborator

Don't construct a QUIC transport if a PSK is provided, since QUIC doesn't provide private network support yet (see libp2p/go-libp2p#1432).

This PR mainly serves to demonstrate how we'd use the new ipnet.PSK for QUIC.

Tracking issue: libp2p/go-libp2p#795.

func NewTransport(key ic.PrivKey) (tpt.Transport, error) {
func NewTransport(key ic.PrivKey, psk pnet.PSK) (tpt.Transport, error) {
if len(psk) > 0 {
log.Error("QUIC doesn't support private networks yet.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: when we actually implement this, let's derive a new shared secret by hashing "quic-pnet" + PSK.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stebalien I've proposed to use a HKDF for that in libp2p/specs#250

@Stebalien Stebalien merged commit 4c8be8c into master Mar 7, 2020
@Stebalien Stebalien deleted the accept-psk branch March 7, 2020 01:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants