From e16340b07be59a6138d1b01dfe30132df9bb357e Mon Sep 17 00:00:00 2001 From: arjain4 <123000778+arjain4@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:44:18 -0500 Subject: [PATCH] Revert "tiles: signing changes for gossip/repair" This reverts commit 3fdf15fbf5951e05026ea99d49006d8354a250be. Revert "keyguard match: edge case for gossip msgs" This reverts commit d0b406b238b2098a8402c6222224008290eb9968. Revert "sign changes for gossip and repair" This reverts commit 49e4998a29237e50f3ee65cc038ef80ad9c6ae86. --- src/app/fdctl/run/tiles/fd_sign.c | 32 ++------------------------ src/disco/keyguard/fd_keyguard.h | 1 - src/disco/keyguard/fd_keyguard_match.c | 2 -- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/src/app/fdctl/run/tiles/fd_sign.c b/src/app/fdctl/run/tiles/fd_sign.c index f6b15c5cbb..a3e0250196 100644 --- a/src/app/fdctl/run/tiles/fd_sign.c +++ b/src/app/fdctl/run/tiles/fd_sign.c @@ -66,6 +66,7 @@ during_frag( void * _ctx, (void)seq; (void)sig; (void)chunk; + (void)sz; (void)opt_filter; fd_sign_ctx_t * ctx = (fd_sign_ctx_t *)_ctx; @@ -78,12 +79,6 @@ during_frag( void * _ctx, case FD_KEYGUARD_ROLE_TLS: fd_memcpy( ctx->_data, ctx->in_data[ in_idx ], 130UL ); break; - case FD_KEYGUARD_ROLE_GOSSIP: - fd_memcpy( ctx->_data, ctx->in_data[ in_idx ], sz ); - break; - case FD_KEYGUARD_ROLE_REPAIR: - fd_memcpy( ctx->_data, ctx->in_data[ in_idx ], sz ); - break; default: FD_LOG_CRIT(( "unexpected link role %lu", ctx->in_role[ in_idx ] )); } @@ -102,6 +97,7 @@ after_frag( void * _ctx, (void)seq; (void)opt_sig; (void)opt_chunk; + (void)opt_sz; (void)opt_tsorig; (void)opt_filter; (void)mux; @@ -125,20 +121,6 @@ after_frag( void * _ctx, fd_ed25519_sign( ctx->out[ in_idx ].data, ctx->_data, 130UL, ctx->public_key, ctx->private_key, ctx->sha512 ); break; } - case FD_KEYGUARD_ROLE_GOSSIP: { - if( FD_UNLIKELY( !fd_keyguard_payload_authorize( ctx->_data, *opt_sz, FD_KEYGUARD_ROLE_GOSSIP ) ) ) { - FD_LOG_EMERG(( "fd_keyguard_payload_authorize failed %lu %u %u %u %u", *opt_sz, ctx->_data[0], ctx->_data[1], ctx->_data[2], ctx->_data[3] )); - } - fd_ed25519_sign( ctx->out[ in_idx ].data, ctx->_data, *opt_sz, ctx->public_key, ctx->private_key, ctx->sha512 ); - break; - } - case FD_KEYGUARD_ROLE_REPAIR: { - if( FD_UNLIKELY( !fd_keyguard_payload_authorize( ctx->_data, *opt_sz, FD_KEYGUARD_ROLE_REPAIR ) ) ) { - FD_LOG_EMERG(( "fd_keyguard_payload_authorize failed %lu %u %u %u %u", *opt_sz, ctx->_data[0], ctx->_data[1], ctx->_data[2], ctx->_data[3] )); - } - fd_ed25519_sign( ctx->out[ in_idx ].data, ctx->_data, *opt_sz, ctx->public_key, ctx->private_key, ctx->sha512 ); - break; - } default: FD_LOG_CRIT(( "unexpected link role %lu", ctx->in_role[ in_idx ] )); } @@ -207,16 +189,6 @@ unprivileged_init( fd_topo_t * topo, FD_TEST( !strcmp( out_link->name, "sign_quic" ) ); FD_TEST( in_link->mtu==130UL ); FD_TEST( out_link->mtu==64UL ); - } else if ( !strcmp( in_link->name, "gossip_sign" ) ) { - ctx->in_role[ i ] = FD_KEYGUARD_ROLE_GOSSIP; - FD_TEST( !strcmp( out_link->name, "sign_gossip" ) ); - FD_TEST( in_link->mtu==2048UL ); - FD_TEST( out_link->mtu==64UL ); - } else if ( !strcmp( in_link->name, "repair_sign")) { - ctx->in_role[ i ] = FD_KEYGUARD_ROLE_REPAIR; - FD_TEST( !strcmp( out_link->name, "repair_gossip" ) ); - FD_TEST( in_link->mtu==2048UL ); - FD_TEST( out_link->mtu==64UL ); } else { FD_LOG_CRIT(( "unexpected link %s", in_link->name )); } diff --git a/src/disco/keyguard/fd_keyguard.h b/src/disco/keyguard/fd_keyguard.h index b20c626eeb..ae53306928 100644 --- a/src/disco/keyguard/fd_keyguard.h +++ b/src/disco/keyguard/fd_keyguard.h @@ -21,7 +21,6 @@ FD_PROTOTYPES_BEGIN #define FD_KEYGUARD_ROLE_LEADER (2) /* block producer (shreds) */ #define FD_KEYGUARD_ROLE_TLS (3) /* TLS peer (certificate verify) */ #define FD_KEYGUARD_ROLE_X509_CA (4) /* self-signed cert CA */ -#define FD_KEYGUARD_ROLE_REPAIR (5) /* repair participant */ /* Type confusion/ambiguity checks ************************************/ diff --git a/src/disco/keyguard/fd_keyguard_match.c b/src/disco/keyguard/fd_keyguard_match.c index 7dc2d24fa9..1e3ebd5a16 100644 --- a/src/disco/keyguard/fd_keyguard_match.c +++ b/src/disco/keyguard/fd_keyguard_match.c @@ -161,8 +161,6 @@ FD_FN_PURE int fd_keyguard_payload_matches_gossip_msg( uchar const * data, ulong sz ) { - // TODO: this causes potential ambiguity with the shred messages - if ( sz==32 ) return 1; /* Every gossip message contains a 4 byte enum variant tag (at the beginning of the message) and a 32 byte public key (at an arbitrary location). */