modify library/x509*.c to use polarssl_snprintf

This commit is contained in:
Rich Evans 2015-01-30 11:00:01 +00:00
parent a18b11f285
commit fac657fd52
4 changed files with 50 additions and 46 deletions

View file

@ -51,8 +51,9 @@
#include "polarssl/platform.h"
#else
#include <stdlib.h>
#define polarssl_malloc malloc
#define polarssl_free free
#define polarssl_malloc malloc
#define polarssl_snprintf snprintf
#endif
#if defined(POLARSSL_FS_IO) || defined(EFIX64) || defined(EFI32)
@ -388,16 +389,16 @@ int x509_csr_info( char *buf, size_t size, const char *prefix,
p = buf;
n = size;
ret = snprintf( p, n, "%sCSR version : %d",
ret = polarssl_snprintf( p, n, "%sCSR version : %d",
prefix, csr->version );
SAFE_SNPRINTF();
ret = snprintf( p, n, "\n%ssubject name : ", prefix );
ret = polarssl_snprintf( p, n, "\n%ssubject name : ", prefix );
SAFE_SNPRINTF();
ret = x509_dn_gets( p, n, &csr->subject );
SAFE_SNPRINTF();
ret = snprintf( p, n, "\n%ssigned using : ", prefix );
ret = polarssl_snprintf( p, n, "\n%ssigned using : ", prefix );
SAFE_SNPRINTF();
ret = x509_sig_alg_gets( p, n, &csr->sig_oid, csr->sig_pk, csr->sig_md,
@ -410,7 +411,7 @@ int x509_csr_info( char *buf, size_t size, const char *prefix,
return( ret );
}
ret = snprintf( p, n, "\n%s%-" BC "s: %d bits\n", prefix, key_size_str,
ret = polarssl_snprintf( p, n, "\n%s%-" BC "s: %d bits\n", prefix, key_size_str,
(int) pk_get_size( &csr->pk ) );
SAFE_SNPRINTF();