( void *, int, size_t ) = memset; void mbedtls_platform_zeroize( void *buf, size_t len ) { if( buf && len > 0 ) memset_func( buf, 0, len ); } void mbedtls_sha256_init( mbedtls_sha256_context *ctx ) { memset( ctx, 0, sizeof( mbedtls_sha256_context ) ); } void ...
In include/mbedtls/platform_util.h, since #8143, we skip the declaration of mbedtls_platform_zeroize in some test builds, based on whether MBEDTLS_TEST_DEFINES_ZEROIZE is defined. There's a good reason for wanting to skip the declaration: we want to make mbedtls_platform_zeroize a macro ...
fclose( f );mbedtls_zeroize( buf,sizeof( buf ) );if( ret !=0)return( ret );return( mbedtls_entropy_write_seed_file( ctx, path ) ); } 开发者ID:Moteesh,项目名称:reactos,代码行数:31,代码来源:entropy.c 示例5: mbedtls_havege_free ▲点赞 1▼ voidmbedtls_havege_free( mbedtls_have...
cleanup: mbedtls_platform_zeroize( sum, sizeof( sum ) );return( ret ); }int mbedtls_md_hmac_update( mbedtls_md_context_t *ctx, const unsigned char *input, size_t ilen ) { if( ctx == NULL || ctx->md_info == NULL || ctx->hmac_ctx == NULL )...
mbedtls_platform_zeroize(local_output, 16); return ret; } int mbedtls_ccm_finish(mbedtls_ccm_context *ctx, unsigned char *tag, size_t tag_len) { int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; unsigned char i; if (ctx->state & CCM_STATE__ERROR) { return MBEDTLS...
}#ifdefined(ESP8266_PLATFORM)if(msg->quiet && msg->ssl.out_buf) { mbedtls_zeroize(msg->ssl.out_buf, MBEDTLS_SSL_OUTBUFFER_LEN); os_free(msg->ssl.out_buf); msg->ssl.out_buf =NULL; }#endifmbedtls_entropy_free(&msg->entropy); ...
mbedtls_platform_zeroize(add_input, sizeof(add_input)); mbedtls_platform_zeroize(tmp, sizeof(tmp)); return ret; } int mbedtls_ctr_drbg_random(void *p_rng, unsigned char *output, size_t output_len) { int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; mbedtls_ctr...
#include“mbedtls/platform.h“#else#include #define mbedtls_printf printf#endif /* MBEDTLS_PLATFORM_C */#endif /* MBEDTLS_SELF_TEST */#if !defined(MBEDTLS_AES_ALT)/* Implementation that should never be optimized out by the compiler */static void mbedtls_zeroize( void *v size_t n ) {...
_PLATFORM_C) 00050 #include "mbedtls/platform.h" 00051 #else 00052 #include <stdlib.h> 00053 #define mbedtls_calloc calloc 00054 #define mbedtls_free free 00055 #endif 00056 00057 /* Implementation that should never be optimized out by the compiler */ 00058 static void mbedtls_zeroize( ...
Description Add a new internal function mbedtls_zeroize_and_free() which is just a wrapper around consecutive calls to mbedtls_platform_zeroize() and mbedtls_free(). This is common enough that it s...