3 #ifdef POLARSSL_BIGNUM_C
10 int verify_none(
void *data,
x509_crt *crt,
int certificate_depth,
int *flags )
14 ((void) certificate_depth);
20 int verify_all(
void *data,
x509_crt *crt,
int certificate_depth,
int *flags )
24 ((void) certificate_depth);
33 #if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C)
39 typedef UINT32 uint32_t;
52 #define GET_UINT32_BE(n,b,i) \
54 (n) = ( (uint32_t) (b)[(i) ] << 24 ) \
55 | ( (uint32_t) (b)[(i) + 1] << 16 ) \
56 | ( (uint32_t) (b)[(i) + 2] << 8 ) \
57 | ( (uint32_t) (b)[(i) + 3] ); \
62 #define PUT_UINT32_BE(n,b,i) \
64 (b)[(i) ] = (unsigned char) ( (n) >> 24 ); \
65 (b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \
66 (b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \
67 (b)[(i) + 3] = (unsigned char) ( (n) ); \
71 static int unhexify(
unsigned char *obuf,
const char *ibuf)
74 int len = strlen(ibuf) / 2;
75 assert(!(strlen(ibuf) %1));
80 if( c >=
'0' && c <=
'9' )
82 else if( c >=
'a' && c <=
'f' )
84 else if( c >=
'A' && c <=
'F' )
90 if( c2 >=
'0' && c2 <=
'9' )
92 else if( c2 >=
'a' && c2 <=
'f' )
94 else if( c2 >=
'A' && c2 <=
'F' )
99 *obuf++ = ( c << 4 ) | c2;
105 static void hexify(
unsigned char *obuf,
const unsigned char *ibuf,
int len)
117 *obuf++ =
'a' + h - 10;
122 *obuf++ =
'a' + l - 10;
138 static int rnd_std_rand(
void *rng_state,
unsigned char *output,
size_t len )
142 if( rng_state != NULL )
145 for( i = 0; i < len; ++i )
156 static int rnd_zero_rand(
void *rng_state,
unsigned char *output,
size_t len )
158 if( rng_state != NULL )
161 memset( output, 0, len );
188 if( rng_state == NULL )
197 memcpy( output, info->
buf, use_len );
198 info->
buf += use_len;
202 if( len - use_len > 0 )
203 return(
rnd_std_rand( NULL, output + use_len, len - use_len ) );
232 uint32_t i, *k, sum, delta=0x9E3779B9;
233 unsigned char result[4];
235 if( rng_state == NULL )
242 size_t use_len = ( len > 4 ) ? 4 : len;
245 for( i = 0; i < 32; i++ )
247 info->
v0 += (((info->
v1 << 4) ^ (info->
v1 >> 5)) + info->
v1) ^ (sum + k[sum & 3]);
249 info->
v1 += (((info->
v0 << 4) ^ (info->
v0 >> 5)) + info->
v0) ^ (sum + k[(sum>>11) & 3]);
253 memcpy( output, result, use_len );
269 static int not_rnd(
void *in,
unsigned char *out,
size_t len )
272 const char *ibuf = in;
274 assert( len == strlen(ibuf) / 2 );
275 assert(!(strlen(ibuf) %1));
277 obuf = out + (len - 1);
281 if( c >=
'0' && c <=
'9' )
283 else if( c >=
'a' && c <=
'f' )
285 else if( c >=
'A' && c <=
'F' )
291 if( c2 >=
'0' && c2 <=
'9' )
293 else if( c2 >=
'a' && c2 <=
'f' )
295 else if( c2 >=
'A' && c2 <=
'F' )
300 *obuf-- = ( c << 4 ) | c2;
312 #ifdef POLARSSL_BIGNUM_C
314 #define TEST_SUITE_ACTIVE
323 printf(
"FAILED\n" );
324 printf(
" %s\n", test );
329 #define TEST_ASSERT( TEST ) \
330 do { test_assert( (TEST) ? 1 : 0, #TEST ); \
331 if( test_errors) return; \
336 if( (*str)[0] !=
'"' ||
337 (*str)[strlen( *str ) - 1] !=
'"' )
339 printf(
"Expected string (with \"\") for parameter and got: %s\n", *str );
344 (*str)[strlen( *str ) - 1] =
'\0';
356 for( i = 0; i < strlen( str ); i++ )
358 if( i == 0 && str[i] ==
'-' )
364 if( ( ( minus && i == 2 ) || ( !minus && i == 1 ) ) &&
365 str[i - 1] ==
'0' && str[i] ==
'x' )
371 if( str[i] <
'0' || str[i] >
'9' )
381 *value = strtol( str, NULL, 16 );
383 *value = strtol( str, NULL, 10 );
388 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_EXTENSIONS + POLARSSL_ERR_ASN1_LENGTH_MISMATCH" ) == 0 )
393 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_VERSION + POLARSSL_ERR_ASN1_OUT_OF_DATA" ) == 0 )
398 if( strcmp( str,
"POLARSSL_ERR_X509_CERT_VERIFY_FAILED" ) == 0 )
403 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_NAME + POLARSSL_ERR_ASN1_UNEXPECTED_TAG" ) == 0 )
408 if( strcmp( str,
"POLARSSL_ERR_X509_UNKNOWN_VERSION" ) == 0 )
413 if( strcmp( str,
"POLARSSL_ERR_ASN1_INVALID_LENGTH" ) == 0 )
418 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_ALG + POLARSSL_ERR_ASN1_OUT_OF_DATA" ) == 0 )
423 if( strcmp( str,
"BADCERT_REVOKED | BADCERT_CN_MISMATCH" ) == 0 )
428 if( strcmp( str,
"POLARSSL_ERR_PK_UNKNOWN_PK_ALG" ) == 0 )
433 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_VERSION + POLARSSL_ERR_ASN1_LENGTH_MISMATCH" ) == 0 )
438 if( strcmp( str,
"POLARSSL_ERR_X509_SIG_MISMATCH" ) == 0 )
443 if( strcmp( str,
"POLARSSL_ERR_PK_INVALID_PUBKEY + POLARSSL_ERR_ASN1_LENGTH_MISMATCH" ) == 0 )
448 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_VERSION + POLARSSL_ERR_ASN1_UNEXPECTED_TAG" ) == 0 )
453 if( strcmp( str,
"POLARSSL_ERR_ASN1_OUT_OF_DATA" ) == 0 )
458 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_SERIAL + POLARSSL_ERR_ASN1_OUT_OF_DATA " ) == 0 )
463 if( strcmp( str,
"BADCERT_CN_MISMATCH" ) == 0 )
468 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_SIGNATURE + POLARSSL_ERR_ASN1_OUT_OF_DATA" ) == 0 )
473 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_VERSION + POLARSSL_ERR_ASN1_INVALID_LENGTH" ) == 0 )
478 if( strcmp( str,
"BADCERT_NOT_TRUSTED" ) == 0 )
483 if( strcmp( str,
"POLARSSL_ERR_PK_KEY_INVALID_FORMAT + POLARSSL_ERR_ASN1_OUT_OF_DATA" ) == 0 )
488 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_SERIAL + POLARSSL_ERR_ASN1_UNEXPECTED_TAG" ) == 0 )
493 if( strcmp( str,
" 1" ) == 0 )
498 if( strcmp( str,
"BADCRL_EXPIRED" ) == 0 )
503 if( strcmp( str,
"POLARSSL_ERR_PK_INVALID_PUBKEY + POLARSSL_ERR_ASN1_OUT_OF_DATA" ) == 0 )
508 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_FORMAT + POLARSSL_ERR_ASN1_OUT_OF_DATA" ) == 0 )
513 if( strcmp( str,
"BADCERT_REVOKED | BADCRL_EXPIRED" ) == 0 )
518 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_DATE + POLARSSL_ERR_ASN1_OUT_OF_DATA" ) == 0 )
523 if( strcmp( str,
"BADCERT_REVOKED" ) == 0 )
528 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_EXTENSIONS + POLARSSL_ERR_ASN1_UNEXPECTED_TAG" ) == 0 )
533 if( strcmp( str,
"POLARSSL_ERR_PK_INVALID_ALG + POLARSSL_ERR_ASN1_OUT_OF_DATA" ) == 0 )
538 if( strcmp( str,
"POLARSSL_ERR_X509_UNKNOWN_SIG_ALG + POLARSSL_ERR_OID_NOT_FOUND" ) == 0 )
543 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_SIGNATURE + POLARSSL_ERR_ASN1_INVALID_DATA" ) == 0 )
548 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_FORMAT + POLARSSL_ERR_ASN1_LENGTH_MISMATCH" ) == 0 )
553 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_DATE + POLARSSL_ERR_ASN1_UNEXPECTED_TAG" ) == 0 )
558 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_ALG + POLARSSL_ERR_ASN1_UNEXPECTED_TAG" ) == 0 )
563 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_EXTENSIONS + POLARSSL_ERR_ASN1_OUT_OF_DATA" ) == 0 )
568 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_DATE" ) == 0 )
573 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_FORMAT + POLARSSL_ERR_ASN1_UNEXPECTED_TAG" ) == 0 )
578 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_FORMAT + POLARSSL_ERR_ASN1_INVALID_LENGTH" ) == 0 )
583 if( strcmp( str,
"BADCERT_OTHER" ) == 0 )
588 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_FORMAT" ) == 0 )
593 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_SERIAL + POLARSSL_ERR_ASN1_OUT_OF_DATA" ) == 0 )
598 if( strcmp( str,
"POLARSSL_ERR_PK_INVALID_PUBKEY + POLARSSL_ERR_ASN1_INVALID_DATA" ) == 0 )
603 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_ALG + POLARSSL_ERR_ASN1_LENGTH_MISMATCH" ) == 0 )
608 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_DATE + POLARSSL_ERR_ASN1_LENGTH_MISMATCH" ) == 0 )
613 if( strcmp( str,
"BADCERT_REVOKED | BADCRL_EXPIRED | BADCERT_CN_MISMATCH" ) == 0 )
618 if( strcmp( str,
"POLARSSL_ERR_X509_INVALID_NAME + POLARSSL_ERR_ASN1_OUT_OF_DATA" ) == 0 )
623 if( strcmp( str,
"POLARSSL_ERR_X509_UNKNOWN_SIG_ALG" ) == 0 )
628 if( strcmp( str,
"POLARSSL_ERR_PK_INVALID_PUBKEY + POLARSSL_ERR_ASN1_UNEXPECTED_TAG" ) == 0 )
633 if( strcmp( str,
"BADCERT_CN_MISMATCH + BADCERT_NOT_TRUSTED" ) == 0 )
638 if( strcmp( str,
"POLARSSL_ERR_PK_INVALID_PUBKEY" ) == 0 )
645 printf(
"Expected integer for parameter and got: %s\n", str );
649 #ifdef POLARSSL_FS_IO
650 #ifdef POLARSSL_X509_CRT_PARSE_C
651 void test_suite_x509_cert_info(
char *crt_file,
char *result_str )
658 memset( buf, 0, 2000 );
673 #ifdef POLARSSL_FS_IO
674 #ifdef POLARSSL_X509_CRL_PARSE_C
675 void test_suite_x509_crl_info(
char *crl_file,
char *result_str )
682 memset( buf, 0, 2000 );
697 #ifdef POLARSSL_FS_IO
698 #ifdef POLARSSL_X509_CRT_PARSE_C
699 #ifdef POLARSSL_X509_CRL_PARSE_C
700 void test_suite_x509_verify(
char *crt_file,
char *ca_file,
char *crl_file,
701 char *cn_name_str,
int result,
int flags_result,
702 char *verify_callback )
709 int (*f_vrfy)(
void *,
x509_crt *, int,
int *) = NULL;
710 char * cn_name = NULL;
716 if( strcmp( cn_name_str,
"NULL" ) != 0 )
717 cn_name = cn_name_str;
719 if( strcmp( verify_callback,
"NULL" ) == 0 )
721 else if( strcmp( verify_callback,
"verify_none" ) == 0 )
722 f_vrfy = verify_none;
723 else if( strcmp( verify_callback,
"verify_all" ) == 0 )
726 TEST_ASSERT(
"No known verify callback selected" == 0 );
732 res =
x509_crt_verify( &crt, &ca, &crl, cn_name, &flags, f_vrfy, NULL );
745 #ifdef POLARSSL_FS_IO
746 #ifdef POLARSSL_X509_USE_C
747 void test_suite_x509_dn_gets(
char *crt_file,
char *entity,
char *result_str )
754 memset( buf, 0, 2000 );
757 if( strcmp( entity,
"subject" ) == 0 )
759 else if( strcmp( entity,
"issuer" ) == 0 )
774 #ifdef POLARSSL_FS_IO
775 #ifdef POLARSSL_X509_USE_C
776 void test_suite_x509_time_expired(
char *crt_file,
char *entity,
int result )
784 if( strcmp( entity,
"valid_from" ) == 0 )
786 else if( strcmp( entity,
"valid_to" ) == 0 )
796 #ifdef POLARSSL_X509_CRT_PARSE_C
797 void test_suite_x509parse_crt(
char *crt_data,
char *result_str,
int result )
800 unsigned char buf[2000];
801 unsigned char output[2000];
805 memset( buf, 0, 2000 );
806 memset( output, 0, 2000 );
808 data_len =
unhexify( buf, crt_data );
811 if( ( result ) == 0 )
818 TEST_ASSERT( strcmp( (
char *) output, result_str ) == 0 );
825 #ifdef POLARSSL_X509_CRL_PARSE_C
826 void test_suite_x509parse_crl(
char *crl_data,
char *result_str,
int result )
829 unsigned char buf[2000];
830 unsigned char output[2000];
834 memset( buf, 0, 2000 );
835 memset( output, 0, 2000 );
837 data_len =
unhexify( buf, crl_data );
840 if( ( result ) == 0 )
847 TEST_ASSERT( strcmp( (
char *) output, result_str ) == 0 );
854 #ifdef POLARSSL_X509_CRT_PARSE_C
855 #ifdef POLARSSL_SELF_TEST
856 void test_suite_x509_selftest()
872 if( strcmp( str,
"POLARSSL_MD4_C" ) == 0 )
874 #if defined(POLARSSL_MD4_C)
880 if( strcmp( str,
"POLARSSL_SHA1_C" ) == 0 )
882 #if defined(POLARSSL_SHA1_C)
888 if( strcmp( str,
"POLARSSL_PKCS1_V15" ) == 0 )
890 #if defined(POLARSSL_PKCS1_V15)
896 if( strcmp( str,
"POLARSSL_PEM_PARSE_C" ) == 0 )
898 #if defined(POLARSSL_PEM_PARSE_C)
904 if( strcmp( str,
"POLARSSL_MD5_C" ) == 0 )
906 #if defined(POLARSSL_MD5_C)
912 if( strcmp( str,
"POLARSSL_ECDSA_C" ) == 0 )
914 #if defined(POLARSSL_ECDSA_C)
920 if( strcmp( str,
"POLARSSL_SHA256_C" ) == 0 )
922 #if defined(POLARSSL_SHA256_C)
928 if( strcmp( str,
"POLARSSL_ECP_DP_SECP192R1_ENABLED" ) == 0 )
930 #if defined(POLARSSL_ECP_DP_SECP192R1_ENABLED)
936 if( strcmp( str,
"POLARSSL_ECP_C" ) == 0 )
938 #if defined(POLARSSL_ECP_C)
944 if( strcmp( str,
"POLARSSL_RSA_C" ) == 0 )
946 #if defined(POLARSSL_RSA_C)
952 if( strcmp( str,
"POLARSSL_ECP_DP_SECP256R1_ENABLED" ) == 0 )
954 #if defined(POLARSSL_ECP_DP_SECP256R1_ENABLED)
960 if( strcmp( str,
"POLARSSL_SHA512_C" ) == 0 )
962 #if defined(POLARSSL_SHA512_C)
968 if( strcmp( str,
"POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3" ) == 0 )
970 #if defined(POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3)
987 #if defined(TEST_SUITE_ACTIVE)
988 if( strcmp( params[0],
"x509_cert_info" ) == 0 )
990 #ifdef POLARSSL_FS_IO
991 #ifdef POLARSSL_X509_CRT_PARSE_C
993 char *param1 = params[1];
994 char *param2 = params[2];
998 fprintf( stderr,
"\nIncorrect argument count (%d != %d)\n", cnt, 3 );
1005 test_suite_x509_cert_info( param1, param2 );
1013 if( strcmp( params[0],
"x509_crl_info" ) == 0 )
1015 #ifdef POLARSSL_FS_IO
1016 #ifdef POLARSSL_X509_CRL_PARSE_C
1018 char *param1 = params[1];
1019 char *param2 = params[2];
1023 fprintf( stderr,
"\nIncorrect argument count (%d != %d)\n", cnt, 3 );
1030 test_suite_x509_crl_info( param1, param2 );
1038 if( strcmp( params[0],
"x509_verify" ) == 0 )
1040 #ifdef POLARSSL_FS_IO
1041 #ifdef POLARSSL_X509_CRT_PARSE_C
1042 #ifdef POLARSSL_X509_CRL_PARSE_C
1044 char *param1 = params[1];
1045 char *param2 = params[2];
1046 char *param3 = params[3];
1047 char *param4 = params[4];
1050 char *param7 = params[7];
1054 fprintf( stderr,
"\nIncorrect argument count (%d != %d)\n", cnt, 8 );
1062 if(
verify_int( params[5], ¶m5 ) != 0 )
return( 2 );
1063 if(
verify_int( params[6], ¶m6 ) != 0 )
return( 2 );
1066 test_suite_x509_verify( param1, param2, param3, param4, param5, param6, param7 );
1075 if( strcmp( params[0],
"x509_dn_gets" ) == 0 )
1077 #ifdef POLARSSL_FS_IO
1078 #ifdef POLARSSL_X509_USE_C
1080 char *param1 = params[1];
1081 char *param2 = params[2];
1082 char *param3 = params[3];
1086 fprintf( stderr,
"\nIncorrect argument count (%d != %d)\n", cnt, 4 );
1094 test_suite_x509_dn_gets( param1, param2, param3 );
1102 if( strcmp( params[0],
"x509_time_expired" ) == 0 )
1104 #ifdef POLARSSL_FS_IO
1105 #ifdef POLARSSL_X509_USE_C
1107 char *param1 = params[1];
1108 char *param2 = params[2];
1113 fprintf( stderr,
"\nIncorrect argument count (%d != %d)\n", cnt, 4 );
1119 if(
verify_int( params[3], ¶m3 ) != 0 )
return( 2 );
1121 test_suite_x509_time_expired( param1, param2, param3 );
1129 if( strcmp( params[0],
"x509parse_crt" ) == 0 )
1131 #ifdef POLARSSL_X509_CRT_PARSE_C
1133 char *param1 = params[1];
1134 char *param2 = params[2];
1139 fprintf( stderr,
"\nIncorrect argument count (%d != %d)\n", cnt, 4 );
1145 if(
verify_int( params[3], ¶m3 ) != 0 )
return( 2 );
1147 test_suite_x509parse_crt( param1, param2, param3 );
1154 if( strcmp( params[0],
"x509parse_crl" ) == 0 )
1156 #ifdef POLARSSL_X509_CRL_PARSE_C
1158 char *param1 = params[1];
1159 char *param2 = params[2];
1164 fprintf( stderr,
"\nIncorrect argument count (%d != %d)\n", cnt, 4 );
1170 if(
verify_int( params[3], ¶m3 ) != 0 )
return( 2 );
1172 test_suite_x509parse_crl( param1, param2, param3 );
1179 if( strcmp( params[0],
"x509_selftest" ) == 0 )
1181 #ifdef POLARSSL_X509_CRT_PARSE_C
1182 #ifdef POLARSSL_SELF_TEST
1187 fprintf( stderr,
"\nIncorrect argument count (%d != %d)\n", cnt, 1 );
1192 test_suite_x509_selftest( );
1202 fprintf( stdout,
"FAILED\nSkipping unknown test function '%s'\n", params[0] );
1216 ret = fgets( buf, len, f );
1220 if( strlen( buf ) && buf[strlen(buf) - 1] ==
'\n' )
1221 buf[strlen(buf) - 1] =
'\0';
1222 if( strlen( buf ) && buf[strlen(buf) - 1] ==
'\r' )
1223 buf[strlen(buf) - 1] =
'\0';
1234 params[cnt++] = cur;
1236 while( *p !=
'\0' && p < buf + len )
1246 if( p + 1 < buf + len )
1249 params[cnt++] = cur;
1258 for( i = 0; i < cnt; i++ )
1265 if( *p ==
'\\' && *(p + 1) ==
'n' )
1270 else if( *p ==
'\\' && *(p + 1) ==
':' )
1275 else if( *p ==
'\\' && *(p + 1) ==
'?' )
1291 int ret, i, cnt, total_errors = 0, total_tests = 0, total_skipped = 0;
1292 const char *filename =
"/home/iurt/rpmbuild/BUILD/polarssl-1.3.1/tests/suites/test_suite_x509parse.data";
1297 #if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C)
1298 unsigned char alloc_buf[1000000];
1299 memory_buffer_alloc_init( alloc_buf,
sizeof(alloc_buf) );
1302 file = fopen( filename,
"r" );
1305 fprintf( stderr,
"Failed to open\n" );
1309 while( !feof( file ) )
1313 if( ( ret =
get_line( file, buf,
sizeof(buf) ) ) != 0 )
1315 fprintf( stdout,
"%s%.66s",
test_errors ?
"\n" :
"", buf );
1316 fprintf( stdout,
" " );
1317 for( i = strlen( buf ) + 1; i < 67; i++ )
1318 fprintf( stdout,
"." );
1319 fprintf( stdout,
" " );
1324 if( ( ret =
get_line( file, buf,
sizeof(buf) ) ) != 0 )
1328 if( strcmp( params[0],
"depends_on" ) == 0 )
1330 for( i = 1; i < cnt; i++ )
1334 if( ( ret =
get_line( file, buf,
sizeof(buf) ) ) != 0 )
1345 if( skip == 1 || ret == 3 )
1348 fprintf( stdout,
"----\n" );
1353 fprintf( stdout,
"PASS\n" );
1358 fprintf( stderr,
"FAILED: FATAL PARSE ERROR\n" );
1365 if( ( ret =
get_line( file, buf,
sizeof(buf) ) ) != 0 )
1367 if( strlen(buf) != 0 )
1369 fprintf( stderr,
"Should be empty %d\n", (
int) strlen(buf) );
1375 fprintf( stdout,
"\n----------------------------------------------------------------------------\n\n");
1376 if( total_errors == 0 )
1377 fprintf( stdout,
"PASSED" );
1379 fprintf( stdout,
"FAILED" );
1381 fprintf( stdout,
" (%d / %d tests (%d skipped))\n",
1382 total_tests - total_errors, total_tests, total_skipped );
1384 #if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C)
1385 #if defined(POLARSSL_MEMORY_DEBUG)
1386 memory_buffer_alloc_status();
1388 memory_buffer_alloc_free();
1391 return( total_errors != 0 );