Skip to content

Commit

Permalink
Revert "tiles: signing changes for gossip/repair"
Browse files Browse the repository at this point in the history
This reverts commit 3fdf15f.

Revert "keyguard match: edge case for gossip msgs"

This reverts commit d0b406b.

Revert "sign changes for gossip and repair"

This reverts commit 49e4998.
  • Loading branch information
arjain4 committed Apr 29, 2024
1 parent 3fdf15f commit e16340b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
32 changes: 2 additions & 30 deletions src/app/fdctl/run/tiles/fd_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ] ));
}
Expand All @@ -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;
Expand All @@ -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 ] ));
}
Expand Down Expand Up @@ -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 ));
}
Expand Down
1 change: 0 additions & 1 deletion src/disco/keyguard/fd_keyguard.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ************************************/

Expand Down
2 changes: 0 additions & 2 deletions src/disco/keyguard/fd_keyguard_match.c
Original file line number Diff line number Diff line change
Expand Up @@ -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). */
Expand Down

0 comments on commit e16340b

Please sign in to comment.