upgrade protobuf to 3.1.0 and use with-bytes feature, issues:958

This commit is contained in:
tom
2022-07-14 17:20:01 +08:00
parent 4e45bc0ee0
commit c6c5d2cb98
17 changed files with 148 additions and 148 deletions

View File

@@ -7,7 +7,7 @@ use hbb_common::{
config::{Config, Config2, CONNECT_TIMEOUT, RELAY_PORT},
log,
message_proto::*,
protobuf::{Message as _, ProtobufEnum},
protobuf::{Message as _, Enum},
rendezvous_proto::*,
socket_client,
sodiumoxide::crypto::{box_, secretbox, sign},
@@ -140,7 +140,7 @@ pub async fn create_tcp_connection(
Some(res) => {
let bytes = res?;
if let Ok(msg_in) = Message::parse_from_bytes(&bytes) {
if let Some(message::Union::public_key(pk)) = msg_in.union {
if let Some(message::Union::PublicKey(pk)) = msg_in.union {
if pk.asymmetric_value.len() == box_::PUBLICKEYBYTES {
let nonce = box_::Nonce([0u8; box_::NONCEBYTES]);
let mut pk_ = [0u8; box_::PUBLICKEYBYTES];