mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 00:45:41 +01:00
Introduced entropy_free()
This commit is contained in:
parent
c55988406f
commit
1ffefaca1e
@ -116,6 +116,13 @@ entropy_context;
|
||||
*/
|
||||
void entropy_init( entropy_context *ctx );
|
||||
|
||||
/**
|
||||
* \brief Free the data in the context
|
||||
*
|
||||
* \param ctx Entropy context to free
|
||||
*/
|
||||
void entropy_free( entropy_context *ctx );
|
||||
|
||||
/**
|
||||
* \brief Adds an entropy source to poll
|
||||
*
|
||||
|
@ -64,6 +64,11 @@ void entropy_init( entropy_context *ctx )
|
||||
#endif /* POLARSSL_NO_DEFAULT_ENTROPY_SOURCES */
|
||||
}
|
||||
|
||||
void entropy_free( entropy_context *ctx )
|
||||
{
|
||||
((void) ctx);
|
||||
}
|
||||
|
||||
int entropy_add_source( entropy_context *ctx,
|
||||
f_source_ptr f_source, void *p_source,
|
||||
size_t threshold )
|
||||
|
@ -275,6 +275,7 @@ exit:
|
||||
net_close( server_fd );
|
||||
rsa_free( &rsa );
|
||||
dhm_free( &dhm );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " + Press Enter to exit this program.\n" );
|
||||
|
@ -143,6 +143,7 @@ int main( int argc, char *argv[] )
|
||||
exit:
|
||||
|
||||
mpi_free( &G ); mpi_free( &P ); mpi_free( &Q );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " Press Enter to exit this program.\n" );
|
||||
|
@ -276,6 +276,7 @@ exit:
|
||||
net_close( client_fd );
|
||||
rsa_free( &rsa );
|
||||
dhm_free( &dhm );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " + Press Enter to exit this program.\n" );
|
||||
|
@ -179,6 +179,7 @@ exit:
|
||||
|
||||
ecdsa_free( &ctx_verify );
|
||||
ecdsa_free( &ctx_sign );
|
||||
entropy_free( &entropy );
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
@ -269,6 +269,7 @@ exit:
|
||||
}
|
||||
|
||||
pk_free( &key );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " + Press Enter to exit this program.\n" );
|
||||
|
@ -136,6 +136,7 @@ int main( int argc, char *argv[] )
|
||||
ret = 0;
|
||||
|
||||
exit:
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(POLARSSL_ERROR_C)
|
||||
polarssl_strerror( ret, (char *) buf, sizeof(buf) );
|
||||
|
@ -136,6 +136,7 @@ int main( int argc, char *argv[] )
|
||||
printf( "\n . Done (created \"%s\")\n\n", "result-enc.txt" );
|
||||
|
||||
exit:
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(POLARSSL_ERROR_C)
|
||||
polarssl_strerror( ret, (char *) buf, sizeof(buf) );
|
||||
|
@ -149,6 +149,7 @@ int main( int argc, char *argv[] )
|
||||
|
||||
exit:
|
||||
pk_free( &pk );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(POLARSSL_ERROR_C)
|
||||
polarssl_strerror( ret, (char *) buf, sizeof(buf) );
|
||||
|
@ -160,6 +160,7 @@ int main( int argc, char *argv[] )
|
||||
ret = 0;
|
||||
|
||||
exit:
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " + Press Enter to exit this program.\n" );
|
||||
|
@ -148,6 +148,7 @@ int main( int argc, char *argv[] )
|
||||
printf( "\n . Done (created \"%s\")\n\n", "result-enc.txt" );
|
||||
|
||||
exit:
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " + Press Enter to exit this program.\n" );
|
||||
|
@ -150,6 +150,7 @@ exit:
|
||||
fclose( fpriv );
|
||||
|
||||
rsa_free( &rsa );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " Press Enter to exit this program.\n" );
|
||||
|
@ -156,6 +156,7 @@ int main( int argc, char *argv[] )
|
||||
|
||||
exit:
|
||||
pk_free( &pk );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " + Press Enter to exit this program.\n" );
|
||||
|
@ -81,6 +81,7 @@ int main( int argc, char *argv[] )
|
||||
cleanup:
|
||||
|
||||
fclose( f );
|
||||
entropy_free( &entropy );
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
@ -111,6 +111,7 @@ cleanup:
|
||||
printf("\n");
|
||||
|
||||
fclose( f );
|
||||
entropy_free( &entropy );
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
@ -277,6 +277,7 @@ exit:
|
||||
x509_crt_free( &cacert );
|
||||
net_close( server_fd );
|
||||
ssl_free( &ssl );
|
||||
entropy_free( &entropy );
|
||||
|
||||
memset( &ssl, 0, sizeof( ssl ) );
|
||||
|
||||
|
@ -913,6 +913,7 @@ exit:
|
||||
#endif
|
||||
ssl_session_free( &saved_session );
|
||||
ssl_free( &ssl );
|
||||
entropy_free( &entropy );
|
||||
|
||||
memset( &ssl, 0, sizeof( ssl ) );
|
||||
|
||||
|
@ -361,6 +361,7 @@ exit:
|
||||
x509_crt_free( &srvcert );
|
||||
pk_free( &pkey );
|
||||
ssl_free( &ssl );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " Press Enter to exit this program.\n" );
|
||||
|
@ -791,6 +791,7 @@ exit:
|
||||
x509_crt_free( &cacert );
|
||||
pk_free( &pkey );
|
||||
ssl_free( &ssl );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " + Press Enter to exit this program.\n" );
|
||||
|
@ -367,6 +367,7 @@ exit:
|
||||
#if defined(POLARSSL_SSL_CACHE_C)
|
||||
ssl_cache_free( &cache );
|
||||
#endif
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " Press Enter to exit this program.\n" );
|
||||
|
@ -963,6 +963,7 @@ exit:
|
||||
#endif
|
||||
|
||||
ssl_free( &ssl );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(POLARSSL_SSL_CACHE_C)
|
||||
ssl_cache_free( &cache );
|
||||
|
@ -252,6 +252,7 @@ int main( int argc, char *argv[] )
|
||||
printf( "String value (PolarSSL Private Encrypt, OpenSSL Public Decrypt): '%s'\n", o_priv_decrypted );
|
||||
|
||||
exit:
|
||||
entropy_free( &entropy );
|
||||
|
||||
#ifdef WIN32
|
||||
printf( " + Press Enter to exit this program.\n" );
|
||||
|
@ -401,6 +401,7 @@ exit:
|
||||
x509_crt_free( &srvcert );
|
||||
pk_free( &pkey );
|
||||
ssl_free( &ssl );
|
||||
entropy_free( &entropy );
|
||||
net_close( client_fd );
|
||||
|
||||
return( ret );
|
||||
|
@ -449,6 +449,7 @@ exit:
|
||||
x509_crt_free( &cacert );
|
||||
x509_crt_free( &clicert );
|
||||
pk_free( &pkey );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " + Press Enter to exit this program.\n" );
|
||||
|
@ -329,6 +329,7 @@ exit:
|
||||
|
||||
x509write_csr_free( &req );
|
||||
pk_free( &key );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " + Press Enter to exit this program.\n" );
|
||||
|
@ -650,6 +650,7 @@ exit:
|
||||
pk_free( &loaded_subject_key );
|
||||
pk_free( &loaded_issuer_key );
|
||||
mpi_free( &serial );
|
||||
entropy_free( &entropy );
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf( " + Press Enter to exit this program.\n" );
|
||||
|
@ -528,6 +528,7 @@ void rsa_gen_key( int nrbits, int exponent, int result)
|
||||
}
|
||||
|
||||
rsa_free( &ctx );
|
||||
entropy_free( &entropy );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user