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