Skip to content

Commit

Permalink
gosling: separate protocol and crate version; update fuzz tests to re…
Browse files Browse the repository at this point in the history
…ference protocol version
  • Loading branch information
Richard Pospesel committed Mar 13, 2024
1 parent bcdefd4 commit 02c0483
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 29 deletions.
33 changes: 22 additions & 11 deletions source/gosling/crates/cgosling/fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions source/gosling/crates/gosling/fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion source/gosling/crates/gosling/fuzz/fuzz_targets/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub(crate) const PENDING_REQUEST_STATE: i32 = 0;
pub(crate) const COMPLETE_REQUEST_STATE: i32 = 1;

// gosling constants
pub(crate) const GOSLING_VERSION: &str = "0.1.0";
pub(crate) const GOSLING_VERSION: &str = gosling::gosling::GOSLING_PROTOCOL_VERSION;
pub(crate) const GOSLING_IDENTITY_NAMESPACE: &str = "gosling_identity";
pub(crate) const GOSLING_IDENTITY_BEGIN_HANDSHAKE_FUNCTION: &str = "begin_handshake";
pub(crate) const GOSLING_IDENTITY_SEND_RESPONSE_FUNCTION: &str = "send_response";
Expand Down
2 changes: 1 addition & 1 deletion source/gosling/crates/gosling/src/endpoint_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl EndpointClient {
"begin_handshake",
0,
doc! {
"version" : bson::Bson::String(GOSLING_VERSION.to_string()),
"version" : bson::Bson::String(GOSLING_PROTOCOL_VERSION.to_string()),
"client_identity" : bson::Bson::String(self.client_service_id.to_string()),
"channel" : bson::Bson::String(self.requested_channel.to_string()),
},
Expand Down
2 changes: 1 addition & 1 deletion source/gosling/crates/gosling/src/endpoint_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ impl ApiSet for EndpointServer {
None) // server_cookie
=> {
let valid_version = match args.remove("version") {
Some(Bson::String(value)) => value == GOSLING_VERSION,
Some(Bson::String(value)) => value == GOSLING_PROTOCOL_VERSION,
_ => false,
};
if !valid_version {
Expand Down
4 changes: 3 additions & 1 deletion source/gosling/crates/gosling/src/gosling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ pub enum Error {
EndpointServerError(#[from] endpoint_server::Error),
}

pub(crate) const GOSLING_VERSION: &str = std::env!("CARGO_PKG_VERSION");
pub const GOSLING_CRATE_VERSION: &str = std::env!("CARGO_PKG_VERSION");
pub const GOSLING_PROTOCOL_VERSION: &str = "0.1.0";


pub(crate) const CLIENT_COOKIE_SIZE: usize = 32usize;
pub(crate) const SERVER_COOKIE_SIZE: usize = 32usize;
Expand Down
2 changes: 1 addition & 1 deletion source/gosling/crates/gosling/src/identity_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl IdentityClient {
"begin_handshake",
0,
doc! {
"version" : bson::Bson::String(GOSLING_VERSION.to_string()),
"version" : bson::Bson::String(GOSLING_PROTOCOL_VERSION.to_string()),
"client_identity" : bson::Bson::String(self.client_service_id.to_string()),
"endpoint" : bson::Bson::String(self.requested_endpoint.clone().to_string()),
},
Expand Down
2 changes: 1 addition & 1 deletion source/gosling/crates/gosling/src/identity_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ impl ApiSet for IdentityServer {
None, // endpoint_private_key
) => {
let valid_version = match args.remove("version") {
Some(Bson::String(value)) => value == GOSLING_VERSION,
Some(Bson::String(value)) => value == GOSLING_PROTOCOL_VERSION,
_ => false,
};
if !valid_version {
Expand Down
2 changes: 1 addition & 1 deletion source/gosling/crates/honk-rpc/fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion source/gosling/crates/tor-interface/fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 02c0483

Please sign in to comment.