mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
Add _init() and _free() for hash modules
This commit is contained in:
parent
8cfd9d8c59
commit
5b4af39a36
19 changed files with 346 additions and 73 deletions
|
|
@ -1718,6 +1718,9 @@ static int ssl_parse_server_key_exchange( ssl_context *ssl )
|
|||
md5_context md5;
|
||||
sha1_context sha1;
|
||||
|
||||
md5_init( &md5 );
|
||||
sha1_init( &sha1 );
|
||||
|
||||
hashlen = 36;
|
||||
|
||||
/*
|
||||
|
|
@ -1742,6 +1745,9 @@ static int ssl_parse_server_key_exchange( ssl_context *ssl )
|
|||
sha1_update( &sha1, ssl->handshake->randbytes, 64 );
|
||||
sha1_update( &sha1, ssl->in_msg + 4, params_len );
|
||||
sha1_finish( &sha1, hash + 16 );
|
||||
|
||||
md5_free( &md5 );
|
||||
sha1_free( &sha1 );
|
||||
}
|
||||
else
|
||||
#endif /* POLARSSL_SSL_PROTO_SSL3 || POLARSSL_SSL_PROTO_TLS1 || \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue