mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-09 00:21:18 +08:00
fix: rename BEFORE_COLON and BC to avoid conflicts
Namespace BEFORE_COLON and BC defines by prepending MBEDTLS_ and expanding BC to BEFORE_COLON_STR. This is to avoid naming conflicts with third-party code. No functional change. Signed-off-by: Stefan Gloor <stefan.gloor@siemens.com>
This commit is contained in:
parent
6a9cf11361
commit
b5c079b13c
@ -1743,15 +1743,15 @@ static int x509_info_cert_policies(char **buf, size_t *size,
|
|||||||
/*
|
/*
|
||||||
* Return an informational string about the certificate.
|
* Return an informational string about the certificate.
|
||||||
*/
|
*/
|
||||||
#define BEFORE_COLON 18
|
#define MBEDTLS_BEFORE_COLON 18
|
||||||
#define BC "18"
|
#define MBEDTLS_BEFORE_COLON_STR "18"
|
||||||
int mbedtls_x509_crt_info(char *buf, size_t size, const char *prefix,
|
int mbedtls_x509_crt_info(char *buf, size_t size, const char *prefix,
|
||||||
const mbedtls_x509_crt *crt)
|
const mbedtls_x509_crt *crt)
|
||||||
{
|
{
|
||||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||||
size_t n;
|
size_t n;
|
||||||
char *p;
|
char *p;
|
||||||
char key_size_str[BEFORE_COLON];
|
char key_size_str[MBEDTLS_BEFORE_COLON];
|
||||||
|
|
||||||
p = buf;
|
p = buf;
|
||||||
n = size;
|
n = size;
|
||||||
@ -1805,13 +1805,13 @@ int mbedtls_x509_crt_info(char *buf, size_t size, const char *prefix,
|
|||||||
MBEDTLS_X509_SAFE_SNPRINTF;
|
MBEDTLS_X509_SAFE_SNPRINTF;
|
||||||
|
|
||||||
/* Key size */
|
/* Key size */
|
||||||
if ((ret = mbedtls_x509_key_size_helper(key_size_str, BEFORE_COLON,
|
if ((ret = mbedtls_x509_key_size_helper(key_size_str, MBEDTLS_BEFORE_COLON,
|
||||||
mbedtls_pk_get_name(&crt->pk))) != 0) {
|
mbedtls_pk_get_name(&crt->pk))) != 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = mbedtls_snprintf(p, n, "\n%s%-" BC "s: %d bits", prefix, key_size_str,
|
ret = mbedtls_snprintf(p, n, "\n%s%-" MBEDTLS_BEFORE_COLON_STR "s: %d bits",
|
||||||
(int) mbedtls_pk_get_bitlen(&crt->pk));
|
prefix, key_size_str, (int) mbedtls_pk_get_bitlen(&crt->pk));
|
||||||
MBEDTLS_X509_SAFE_SNPRINTF;
|
MBEDTLS_X509_SAFE_SNPRINTF;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -519,8 +519,8 @@ int mbedtls_x509_csr_parse_file(mbedtls_x509_csr *csr, const char *path)
|
|||||||
#endif /* MBEDTLS_FS_IO */
|
#endif /* MBEDTLS_FS_IO */
|
||||||
|
|
||||||
#if !defined(MBEDTLS_X509_REMOVE_INFO)
|
#if !defined(MBEDTLS_X509_REMOVE_INFO)
|
||||||
#define BEFORE_COLON 14
|
#define MBEDTLS_BEFORE_COLON 14
|
||||||
#define BC "14"
|
#define MBEDTLS_BEFORE_COLON_STR "14"
|
||||||
/*
|
/*
|
||||||
* Return an informational string about the CSR.
|
* Return an informational string about the CSR.
|
||||||
*/
|
*/
|
||||||
@ -530,7 +530,7 @@ int mbedtls_x509_csr_info(char *buf, size_t size, const char *prefix,
|
|||||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||||
size_t n;
|
size_t n;
|
||||||
char *p;
|
char *p;
|
||||||
char key_size_str[BEFORE_COLON];
|
char key_size_str[MBEDTLS_BEFORE_COLON];
|
||||||
|
|
||||||
p = buf;
|
p = buf;
|
||||||
n = size;
|
n = size;
|
||||||
@ -551,13 +551,13 @@ int mbedtls_x509_csr_info(char *buf, size_t size, const char *prefix,
|
|||||||
csr->sig_opts);
|
csr->sig_opts);
|
||||||
MBEDTLS_X509_SAFE_SNPRINTF;
|
MBEDTLS_X509_SAFE_SNPRINTF;
|
||||||
|
|
||||||
if ((ret = mbedtls_x509_key_size_helper(key_size_str, BEFORE_COLON,
|
if ((ret = mbedtls_x509_key_size_helper(key_size_str, MBEDTLS_BEFORE_COLON,
|
||||||
mbedtls_pk_get_name(&csr->pk))) != 0) {
|
mbedtls_pk_get_name(&csr->pk))) != 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = mbedtls_snprintf(p, n, "\n%s%-" BC "s: %d bits\n", prefix, key_size_str,
|
ret = mbedtls_snprintf(p, n, "\n%s%-" MBEDTLS_BEFORE_COLON_STR "s: %d bits\n",
|
||||||
(int) mbedtls_pk_get_bitlen(&csr->pk));
|
prefix, key_size_str, (int) mbedtls_pk_get_bitlen(&csr->pk));
|
||||||
MBEDTLS_X509_SAFE_SNPRINTF;
|
MBEDTLS_X509_SAFE_SNPRINTF;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user