Skip to content

Commit

Permalink
Use crypto/ed25519 from stdlib
Browse files Browse the repository at this point in the history
With Go 1.14 out and the x/crypto/ed25519 wrapper not updated to
fallthrough to the stdlib implementation we've decided to drop Go
1.12 supprot and move to stdlib imports entirely.

Fixes #158
  • Loading branch information
daenney committed Mar 28, 2020
1 parent a63579d commit 129598f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ We would love contributes that fall under the 'Planned Features' and fixing any

### Using

This library needs at least Go 1.13.

#### Pion DTLS
For a DTLS 1.2 Server that listens on 127.0.0.1:4444
```sh
Expand Down
3 changes: 1 addition & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ package dtls
import (
"context"
"crypto/ecdsa"
"crypto/ed25519"
"crypto/tls"
"crypto/x509"
"time"

"golang.org/x/crypto/ed25519"

"github.com/pion/logging"
)

Expand Down
3 changes: 1 addition & 2 deletions crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dtls
import (
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
Expand All @@ -11,8 +12,6 @@ import (
"encoding/binary"
"math/big"
"time"

"golang.org/x/crypto/ed25519"
)

type ecdsaSignature struct {
Expand Down
3 changes: 1 addition & 2 deletions e2e/e2e_v113_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ package e2e

import (
"context"
"crypto/ed25519"
"crypto/rand"
"crypto/tls"
"testing"
"time"

"golang.org/x/crypto/ed25519"

"github.com/pion/dtls/v2"
"github.com/pion/dtls/v2/pkg/crypto/selfsign"
"github.com/pion/transport/test"
Expand Down
3 changes: 1 addition & 2 deletions pkg/crypto/selfsign/selfsign.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package selfsign
import (
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
"crypto/elliptic"
"crypto/rand"
"crypto/tls"
Expand All @@ -13,8 +14,6 @@ import (
"errors"
"math/big"
"time"

"golang.org/x/crypto/ed25519"
)

var errInvalidPrivateKey = errors.New("selfsign: invalid private key type")
Expand Down
2 changes: 1 addition & 1 deletion signature_hash_algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package dtls
import (
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
"crypto/rsa"
"crypto/tls"

"golang.org/x/crypto/ed25519"
"golang.org/x/xerrors"
)

Expand Down

0 comments on commit 129598f

Please sign in to comment.