mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-24 22:25:11 +00:00
Remove spurious '+ 3' in ecdsa_write_signature()
This commit is contained in:
parent
dd0f57f186
commit
4cf0686d6d
|
@ -220,8 +220,8 @@ int ecdsa_write_signature( ecdsa_context *ctx,
|
||||||
void *p_rng )
|
void *p_rng )
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned char buf[MAX_SIG_LEN + 3];
|
unsigned char buf[MAX_SIG_LEN];
|
||||||
unsigned char *p = buf + MAX_SIG_LEN;
|
unsigned char *p = buf + sizeof( buf );
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
|
|
||||||
if( ( ret = ecdsa_sign( &ctx->grp, &ctx->r, &ctx->s, &ctx->d,
|
if( ( ret = ecdsa_sign( &ctx->grp, &ctx->r, &ctx->s, &ctx->d,
|
||||||
|
|
|
@ -135,7 +135,7 @@ int main( int argc, char *argv[] )
|
||||||
printf( " failed\n ! ecdsa_genkey returned %d\n", ret );
|
printf( " failed\n ! ecdsa_genkey returned %d\n", ret );
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
printf( " ok\n" );
|
printf( " ok (signature length = %zu)\n", sig_len );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Signature is serialized as defined by RFC 4492 p. 20,
|
* Signature is serialized as defined by RFC 4492 p. 20,
|
||||||
|
|
Loading…
Reference in a new issue