Skip to content

Rename BEFORE_COLON/BC to avoid conflicts #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions library/x509_crl.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,11 +583,6 @@ int mbedtls_x509_crl_parse_file(mbedtls_x509_crl *chain, const char *path)
#endif /* MBEDTLS_FS_IO */

#if !defined(MBEDTLS_X509_REMOVE_INFO)
/*
* Return an informational string about the certificate.
*/
#define BEFORE_COLON 14
#define BC "14"
/*
* Return an informational string about the CRL.
*/
Expand Down
12 changes: 6 additions & 6 deletions library/x509_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1746,15 +1746,15 @@ static int x509_info_cert_policies(char **buf, size_t *size,
/*
* Return an informational string about the certificate.
*/
#define BEFORE_COLON 18
#define BC "18"
#define MBEDTLS_BEFORE_COLON 18
#define MBEDTLS_BEFORE_COLON_STR "18"
int mbedtls_x509_crt_info(char *buf, size_t size, const char *prefix,
const mbedtls_x509_crt *crt)
{
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
size_t n;
char *p;
char key_size_str[BEFORE_COLON];
char key_size_str[MBEDTLS_BEFORE_COLON];

p = buf;
n = size;
Expand Down Expand Up @@ -1808,13 +1808,13 @@ int mbedtls_x509_crt_info(char *buf, size_t size, const char *prefix,
MBEDTLS_X509_SAFE_SNPRINTF;

/* 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) {
return ret;
}

ret = mbedtls_snprintf(p, n, "\n%s%-" BC "s: %d bits", prefix, key_size_str,
(int) mbedtls_pk_get_bitlen(&crt->pk));
ret = mbedtls_snprintf(p, n, "\n%s%-" MBEDTLS_BEFORE_COLON_STR "s: %d bits",
prefix, key_size_str, (int) mbedtls_pk_get_bitlen(&crt->pk));
MBEDTLS_X509_SAFE_SNPRINTF;

/*
Expand Down
12 changes: 6 additions & 6 deletions library/x509_csr.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,8 @@ int mbedtls_x509_csr_parse_file(mbedtls_x509_csr *csr, const char *path)
#endif /* MBEDTLS_FS_IO */

#if !defined(MBEDTLS_X509_REMOVE_INFO)
#define BEFORE_COLON 14
#define BC "14"
#define MBEDTLS_BEFORE_COLON 14
#define MBEDTLS_BEFORE_COLON_STR "14"
/*
* Return an informational string about the CSR.
*/
Expand All @@ -531,7 +531,7 @@ int mbedtls_x509_csr_info(char *buf, size_t size, const char *prefix,
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
size_t n;
char *p;
char key_size_str[BEFORE_COLON];
char key_size_str[MBEDTLS_BEFORE_COLON];

p = buf;
n = size;
Expand All @@ -552,13 +552,13 @@ int mbedtls_x509_csr_info(char *buf, size_t size, const char *prefix,
csr->sig_opts);
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) {
return ret;
}

ret = mbedtls_snprintf(p, n, "\n%s%-" BC "s: %d bits\n", prefix, key_size_str,
(int) mbedtls_pk_get_bitlen(&csr->pk));
ret = mbedtls_snprintf(p, n, "\n%s%-" MBEDTLS_BEFORE_COLON_STR "s: %d bits\n",
prefix, key_size_str, (int) mbedtls_pk_get_bitlen(&csr->pk));
MBEDTLS_X509_SAFE_SNPRINTF;

/*
Expand Down