mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-22 02:06:18 +08:00
sm2 ke: make sure the peer pub key using same curve
This commit is contained in:
parent
45d6a74b6a
commit
474168700e
@ -93,7 +93,7 @@ func (ke *KeyExchange) SetPeerParameters(peerPub *ecdsa.PublicKey, peerUID []byt
|
||||
return errors.New("sm2: 'peerPub' already exists, please do not set it")
|
||||
}
|
||||
|
||||
if !IsSM2PublicKey(peerPub) {
|
||||
if peerPub.Curve != ke.privateKey.Curve {
|
||||
return errors.New("sm2: peer public key is not expected/supported")
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user