mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Externals: Update mbedtls to 2.28.0
This commit is contained in:
23
Externals/mbedtls/library/md2.c
vendored
23
Externals/mbedtls/library/md2.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* RFC 1115/1319 compliant MD2 implementation
|
||||
*
|
||||
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
|
||||
* Copyright The Mbed TLS Contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
@ -15,8 +15,6 @@
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is part of mbed TLS (https://tls.mbed.org)
|
||||
*/
|
||||
/*
|
||||
* The MD2 algorithm was designed by Ron Rivest in 1989.
|
||||
@ -25,16 +23,13 @@
|
||||
* http://www.ietf.org/rfc/rfc1319.txt
|
||||
*/
|
||||
|
||||
#if !defined(MBEDTLS_CONFIG_FILE)
|
||||
#include "mbedtls/config.h"
|
||||
#else
|
||||
#include MBEDTLS_CONFIG_FILE
|
||||
#endif
|
||||
#include "common.h"
|
||||
|
||||
#if defined(MBEDTLS_MD2_C)
|
||||
|
||||
#include "mbedtls/md2.h"
|
||||
#include "mbedtls/platform_util.h"
|
||||
#include "mbedtls/error.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@ -152,6 +147,9 @@ int mbedtls_internal_md2_process( mbedtls_md2_context *ctx )
|
||||
t = ctx->cksum[i];
|
||||
}
|
||||
|
||||
/* Zeroise variables to clear sensitive data from memory. */
|
||||
mbedtls_platform_zeroize( &t, sizeof( t ) );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
@ -170,7 +168,7 @@ int mbedtls_md2_update_ret( mbedtls_md2_context *ctx,
|
||||
const unsigned char *input,
|
||||
size_t ilen )
|
||||
{
|
||||
int ret;
|
||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||
size_t fill;
|
||||
|
||||
while( ilen > 0 )
|
||||
@ -212,7 +210,7 @@ void mbedtls_md2_update( mbedtls_md2_context *ctx,
|
||||
int mbedtls_md2_finish_ret( mbedtls_md2_context *ctx,
|
||||
unsigned char output[16] )
|
||||
{
|
||||
int ret;
|
||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||
size_t i;
|
||||
unsigned char x;
|
||||
|
||||
@ -250,7 +248,7 @@ int mbedtls_md2_ret( const unsigned char *input,
|
||||
size_t ilen,
|
||||
unsigned char output[16] )
|
||||
{
|
||||
int ret;
|
||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||
mbedtls_md2_context ctx;
|
||||
|
||||
mbedtls_md2_init( &ctx );
|
||||
@ -292,8 +290,7 @@ static const unsigned char md2_test_str[7][81] =
|
||||
{ "message digest" },
|
||||
{ "abcdefghijklmnopqrstuvwxyz" },
|
||||
{ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" },
|
||||
{ "12345678901234567890123456789012345678901234567890123456789012"
|
||||
"345678901234567890" }
|
||||
{ "12345678901234567890123456789012345678901234567890123456789012345678901234567890" }
|
||||
};
|
||||
|
||||
static const size_t md2_test_strlen[7] =
|
||||
|
Reference in New Issue
Block a user