Skip to content

Commit b04800b

Browse files
Ron EldorRon Eldor
authored andcommitted
Return not supported for internal process function
Return the `MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED` for the internal process function, as it is not public.
1 parent d370d58 commit b04800b

File tree

2 files changed

+4
-32
lines changed

2 files changed

+4
-32
lines changed

features/cryptocell/FEATURE_CRYPTOCELL310/sha1_alt.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "mbedtls/sha1.h"
2222
#if defined(MBEDTLS_SHA1_ALT)
2323
#include <string.h>
24+
#include "mbedtls/platform.h"
2425

2526
void mbedtls_sha1_init( mbedtls_sha1_context *ctx )
2627
{
@@ -91,21 +92,6 @@ int mbedtls_sha1_finish_ret( mbedtls_sha1_context *ctx,
9192
int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx,
9293
const unsigned char data[64] )
9394
{
94-
int ret = 0;
95-
if( ctx->is_cc_initiated == 0 )
96-
{
97-
ret = init_cc( ctx );
98-
if( ret != 0 )
99-
goto exit;
100-
}
101-
102-
if( CRYS_HASH_Update( &ctx->crys_hash_ctx, (uint8_t*)data, 64 ) != CRYS_OK )
103-
{
104-
ret = MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED;
105-
goto exit;
106-
}
107-
108-
exit:
109-
return ( ret );
95+
return( MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED );
11096
}
11197
#endif //MBEDTLS_SHA1_ALT

features/cryptocell/FEATURE_CRYPTOCELL310/sha256_alt.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "mbedtls/sha256.h"
2222
#if defined(MBEDTLS_SHA256_ALT)
2323
#include <string.h>
24+
#include "mbedtls/platform.h"
2425

2526
void mbedtls_sha256_init( mbedtls_sha256_context *ctx )
2627
{
@@ -66,22 +67,7 @@ int mbedtls_sha256_starts_ret( mbedtls_sha256_context *ctx, int is224 )
6667
int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx,
6768
const unsigned char data[64] )
6869
{
69-
int ret = 0;
70-
if( ctx->is_cc_initiated == 0 )
71-
{
72-
ret = init_cc( ctx, 0 );
73-
if( ret != 0 )
74-
goto exit;
75-
}
76-
77-
if( CRYS_HASH_Update( &ctx->crys_hash_ctx, (uint8_t*)data, 64 ) != CRYS_OK )
78-
{
79-
ret = MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED;
80-
goto exit;
81-
}
82-
83-
exit:
84-
return ( ret );
70+
return( MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED );
8571
}
8672

8773
int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx,

0 commit comments

Comments
 (0)