support new starcrypto package

This commit is contained in:
2022-04-27 13:45:22 +08:00
parent 2db6102668
commit 996f94eef0
3 changed files with 27 additions and 12 deletions
+5 -1
View File
@@ -497,7 +497,11 @@ func (c *ClientCommon) Reply(m Message, value MsgVal) error {
}
func (c *ClientCommon) ExchangeKey(newKey []byte) error {
newSendKey, err := starcrypto.RSAEncrypt(newKey, c.handshakeRsaPubKey)
pubKey, err := starcrypto.DecodePublicKey(c.handshakeRsaPubKey)
if err != nil {
return err
}
newSendKey, err := starcrypto.RSAEncrypt(pubKey, newKey)
if err != nil {
return err
}