Remove individual mdX_file() and shaX_file()
This commit is contained in:
parent
06d5d61302
commit
41b9c2b418
21 changed files with 4 additions and 703 deletions
|
@ -38,10 +38,6 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#if defined(MBEDTLS_FS_IO)
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_SELF_TEST)
|
||||
#if defined(MBEDTLS_PLATFORM_C)
|
||||
#include "mbedtls/platform.h"
|
||||
|
@ -213,40 +209,6 @@ void mbedtls_md2( const unsigned char *input, size_t ilen, unsigned char output[
|
|||
mbedtls_md2_free( &ctx );
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_FS_IO)
|
||||
/*
|
||||
* output = MD2( file contents )
|
||||
*/
|
||||
int mbedtls_md2_file( const char *path, unsigned char output[16] )
|
||||
{
|
||||
FILE *f;
|
||||
size_t n;
|
||||
mbedtls_md2_context ctx;
|
||||
unsigned char buf[1024];
|
||||
|
||||
if( ( f = fopen( path, "rb" ) ) == NULL )
|
||||
return( MBEDTLS_ERR_MD2_FILE_IO_ERROR );
|
||||
|
||||
mbedtls_md2_init( &ctx );
|
||||
mbedtls_md2_starts( &ctx );
|
||||
|
||||
while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
|
||||
mbedtls_md2_update( &ctx, buf, n );
|
||||
|
||||
mbedtls_md2_finish( &ctx, output );
|
||||
mbedtls_md2_free( &ctx );
|
||||
|
||||
if( ferror( f ) != 0 )
|
||||
{
|
||||
fclose( f );
|
||||
return( MBEDTLS_ERR_MD2_FILE_IO_ERROR );
|
||||
}
|
||||
|
||||
fclose( f );
|
||||
return( 0 );
|
||||
}
|
||||
#endif /* MBEDTLS_FS_IO */
|
||||
|
||||
#if defined(MBEDTLS_SELF_TEST)
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue