chop first byte when cryptoid.PubKeyS is set from identity.Pubkey() since this is directly copied in the auth message
This commit is contained in:
parent
1f2adb05b5
commit
20aade56c3
@ -7,10 +7,13 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
|
ethlogger "github.com/ethereum/go-ethereum/logger"
|
||||||
"github.com/obscuren/ecies"
|
"github.com/obscuren/ecies"
|
||||||
"github.com/obscuren/secp256k1-go"
|
"github.com/obscuren/secp256k1-go"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var clogger = ethlogger.NewLogger("CRYPTOID")
|
||||||
|
|
||||||
var (
|
var (
|
||||||
sskLen int = 16 // ecies.MaxSharedKeyLength(pubKey) / 2
|
sskLen int = 16 // ecies.MaxSharedKeyLength(pubKey) / 2
|
||||||
sigLen int = 65 // elliptic S256
|
sigLen int = 65 // elliptic S256
|
||||||
@ -62,10 +65,17 @@ func newCryptoId(id ClientIdentity) (self *cryptoId, err error) {
|
|||||||
// to be created at server init shared between peers and sessions
|
// to be created at server init shared between peers and sessions
|
||||||
// for reuse, call wth ReadAt, no reset seek needed
|
// for reuse, call wth ReadAt, no reset seek needed
|
||||||
}
|
}
|
||||||
self.pubKeyS = id.Pubkey()
|
self.pubKeyS = id.Pubkey()[1:]
|
||||||
|
clogger.Debugf("crytoid starting for %v", hexkey(self.pubKeyS))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type hexkey []byte
|
||||||
|
|
||||||
|
func (self hexkey) String() string {
|
||||||
|
return fmt.Sprintf("(%d) %x", len(self), []byte(self))
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Run(connection, remotePublicKey, sessionToken) is called when the peer connection starts to set up a secure session by performing a crypto handshake.
|
Run(connection, remotePublicKey, sessionToken) is called when the peer connection starts to set up a secure session by performing a crypto handshake.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user