mirror of
https://github.com/go-i2p/go-i2p.git
synced 2025-07-17 13:54:33 -04:00
gofumpt
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
// log "github.com/sirupsen/logrus"
|
||||
|
@ -2,6 +2,7 @@ package data
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@ -91,13 +92,12 @@ func (str I2PString) Data() (data string, err error) {
|
||||
case ErrDataTooLong:
|
||||
log.WithError(err).Warn("I2PString contains data beyond specified length")
|
||||
data = string(str[1:])
|
||||
//data = string(str[1 : length+1]) // Should we recover and trim?
|
||||
// data = string(str[1 : length+1]) // Should we recover and trim?
|
||||
return
|
||||
default:
|
||||
log.WithError(err).Error("Unknown error encountered in I2PString.Data()")
|
||||
return "", err
|
||||
}
|
||||
|
||||
}
|
||||
if length == 0 {
|
||||
log.Debug("I2PString is empty")
|
||||
|
@ -379,6 +379,7 @@ func KeyCertificateFromCertificate(certificate Certificate) (*KeyCertificate, er
|
||||
log.Debug("Successfully created keyCertificate from Certificate")
|
||||
return k, nil
|
||||
}
|
||||
|
||||
func NewKeyCertificateFromCertificate(cert Certificate) (*KeyCertificate, error) {
|
||||
payload := cert.Data()
|
||||
if len(payload) < 4 {
|
||||
|
@ -418,6 +418,7 @@ func readCertificateFromEnd(data []byte) (cert Certificate, certStartIndex int,
|
||||
err = errors.New("could not find certificate in data")
|
||||
return
|
||||
}
|
||||
|
||||
func constructPublicKey(data []byte, cryptoType uint16) (crypto.PublicKey, error) {
|
||||
switch cryptoType {
|
||||
case CRYPTO_KEY_TYPE_ELGAMAL:
|
||||
|
@ -3,12 +3,13 @@ package keys_and_cert
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"testing"
|
||||
|
||||
"github.com/go-i2p/go-i2p/lib/common/certificate"
|
||||
"github.com/go-i2p/go-i2p/lib/common/data"
|
||||
"github.com/go-i2p/go-i2p/lib/common/key_certificate"
|
||||
"github.com/go-i2p/go-i2p/lib/crypto"
|
||||
"golang.org/x/crypto/openpgp/elgamal"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
@ -4,10 +4,11 @@ package lease
|
||||
import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
. "github.com/go-i2p/go-i2p/lib/common/data"
|
||||
"github.com/go-i2p/go-i2p/lib/util/logger"
|
||||
"github.com/sirupsen/logrus"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Sizes in bytes of various components of a Lease
|
||||
|
@ -4,6 +4,7 @@ package lease_set
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/go-i2p/go-i2p/lib/common/signature"
|
||||
|
||||
"github.com/go-i2p/go-i2p/lib/util/logger"
|
||||
|
@ -4,13 +4,14 @@ import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/go-i2p/go-i2p/lib/common/data"
|
||||
"github.com/go-i2p/go-i2p/lib/common/destination"
|
||||
"github.com/go-i2p/go-i2p/lib/common/keys_and_cert"
|
||||
"github.com/go-i2p/go-i2p/lib/crypto"
|
||||
"golang.org/x/crypto/openpgp/elgamal"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/go-i2p/go-i2p/lib/common/certificate"
|
||||
"github.com/go-i2p/go-i2p/lib/common/lease"
|
||||
|
@ -4,11 +4,12 @@ import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"encoding/binary"
|
||||
"github.com/go-i2p/go-i2p/lib/common/key_certificate"
|
||||
"github.com/go-i2p/go-i2p/lib/common/keys_and_cert"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/go-i2p/go-i2p/lib/common/key_certificate"
|
||||
"github.com/go-i2p/go-i2p/lib/common/keys_and_cert"
|
||||
|
||||
"github.com/go-i2p/go-i2p/lib/common/signature"
|
||||
|
||||
"github.com/go-i2p/go-i2p/lib/common/certificate"
|
||||
|
@ -4,6 +4,9 @@ import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/go-i2p/go-i2p/lib/common/certificate"
|
||||
"github.com/go-i2p/go-i2p/lib/common/data"
|
||||
"github.com/go-i2p/go-i2p/lib/common/key_certificate"
|
||||
@ -12,8 +15,6 @@ import (
|
||||
"github.com/go-i2p/go-i2p/lib/crypto"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"golang.org/x/crypto/openpgp/elgamal"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/go-i2p/go-i2p/lib/common/router_address"
|
||||
)
|
||||
|
Reference in New Issue
Block a user