mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
Generalized function names of x509 functions not parse-specific
x509parse_serial_gets -> x509_serial_gets x509parse_dn_gets -> x509_dn_gets x509parse_time_expired -> x509_time_expired
This commit is contained in:
@@ -480,7 +480,7 @@ static int compat_snprintf(char *str, size_t size, const char *format, ...)
|
||||
* Store the name in printable form into buf; no more
|
||||
* than size characters will be written
|
||||
*/
|
||||
int x509parse_dn_gets( char *buf, size_t size, const x509_name *dn )
|
||||
int x509_dn_gets( char *buf, size_t size, const x509_name *dn )
|
||||
{
|
||||
int ret;
|
||||
size_t i, n;
|
||||
@@ -540,7 +540,7 @@ int x509parse_dn_gets( char *buf, size_t size, const x509_name *dn )
|
||||
* Store the serial in printable form into buf; no more
|
||||
* than size characters will be written
|
||||
*/
|
||||
int x509parse_serial_gets( char *buf, size_t size, const x509_buf *serial )
|
||||
int x509_serial_gets( char *buf, size_t size, const x509_buf *serial )
|
||||
{
|
||||
int ret;
|
||||
size_t i, n, nr;
|
||||
@@ -615,7 +615,7 @@ int x509_oid_get_numeric_string( char *buf, size_t size, x509_buf *oid )
|
||||
* Return 0 if the x509_time is still valid, or 1 otherwise.
|
||||
*/
|
||||
#if defined(POLARSSL_HAVE_TIME)
|
||||
int x509parse_time_expired( const x509_time *to )
|
||||
int x509_time_expired( const x509_time *to )
|
||||
{
|
||||
int year, mon, day;
|
||||
int hour, min, sec;
|
||||
@@ -682,7 +682,7 @@ int x509parse_time_expired( const x509_time *to )
|
||||
return( 0 );
|
||||
}
|
||||
#else /* POLARSSL_HAVE_TIME */
|
||||
int x509parse_time_expired( const x509_time *to )
|
||||
int x509_time_expired( const x509_time *to )
|
||||
{
|
||||
((void) to);
|
||||
return( 0 );
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include "polarssl/asn1write.h"
|
||||
#include "polarssl/oid.h"
|
||||
|
||||
int x509write_string_to_names( asn1_named_data **head, char *name )
|
||||
int x509_string_to_names( asn1_named_data **head, char *name )
|
||||
{
|
||||
int ret = 0;
|
||||
char *s = name, *c = s;
|
||||
|
@@ -621,7 +621,7 @@ int x509parse_crl_info( char *buf, size_t size, const char *prefix,
|
||||
|
||||
ret = snprintf( p, n, "\n%sissuer name : ", prefix );
|
||||
SAFE_SNPRINTF();
|
||||
ret = x509parse_dn_gets( p, n, &crl->issuer );
|
||||
ret = x509_dn_gets( p, n, &crl->issuer );
|
||||
SAFE_SNPRINTF();
|
||||
|
||||
ret = snprintf( p, n, "\n%sthis update : " \
|
||||
@@ -650,7 +650,7 @@ int x509parse_crl_info( char *buf, size_t size, const char *prefix,
|
||||
prefix );
|
||||
SAFE_SNPRINTF();
|
||||
|
||||
ret = x509parse_serial_gets( p, n, &entry->serial);
|
||||
ret = x509_serial_gets( p, n, &entry->serial);
|
||||
SAFE_SNPRINTF();
|
||||
|
||||
ret = snprintf( p, n, " revocation date: " \
|
||||
|
@@ -1100,17 +1100,17 @@ int x509parse_cert_info( char *buf, size_t size, const char *prefix,
|
||||
prefix );
|
||||
SAFE_SNPRINTF();
|
||||
|
||||
ret = x509parse_serial_gets( p, n, &crt->serial);
|
||||
ret = x509_serial_gets( p, n, &crt->serial);
|
||||
SAFE_SNPRINTF();
|
||||
|
||||
ret = snprintf( p, n, "\n%sissuer name : ", prefix );
|
||||
SAFE_SNPRINTF();
|
||||
ret = x509parse_dn_gets( p, n, &crt->issuer );
|
||||
ret = x509_dn_gets( p, n, &crt->issuer );
|
||||
SAFE_SNPRINTF();
|
||||
|
||||
ret = snprintf( p, n, "\n%ssubject name : ", prefix );
|
||||
SAFE_SNPRINTF();
|
||||
ret = x509parse_dn_gets( p, n, &crt->subject );
|
||||
ret = x509_dn_gets( p, n, &crt->subject );
|
||||
SAFE_SNPRINTF();
|
||||
|
||||
ret = snprintf( p, n, "\n%sissued on : " \
|
||||
@@ -1163,7 +1163,7 @@ int x509parse_revoked( const x509_cert *crt, const x509_crl *crl )
|
||||
if( crt->serial.len == cur->serial.len &&
|
||||
memcmp( crt->serial.p, cur->serial.p, crt->serial.len ) == 0 )
|
||||
{
|
||||
if( x509parse_time_expired( &cur->revocation_date ) )
|
||||
if( x509_time_expired( &cur->revocation_date ) )
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
@@ -1229,7 +1229,7 @@ static int x509parse_verifycrl(x509_cert *crt, x509_cert *ca,
|
||||
/*
|
||||
* Check for validity of CRL (Do not drop out)
|
||||
*/
|
||||
if( x509parse_time_expired( &crl_list->next_update ) )
|
||||
if( x509_time_expired( &crl_list->next_update ) )
|
||||
flags |= BADCRL_EXPIRED;
|
||||
|
||||
/*
|
||||
@@ -1310,7 +1310,7 @@ static int x509parse_verify_top(
|
||||
unsigned char hash[POLARSSL_MD_MAX_SIZE];
|
||||
const md_info_t *md_info;
|
||||
|
||||
if( x509parse_time_expired( &child->valid_to ) )
|
||||
if( x509_time_expired( &child->valid_to ) )
|
||||
*flags |= BADCERT_EXPIRED;
|
||||
|
||||
/*
|
||||
@@ -1388,7 +1388,7 @@ static int x509parse_verify_top(
|
||||
*flags |= x509parse_verifycrl( child, trust_ca, ca_crl );
|
||||
#endif
|
||||
|
||||
if( x509parse_time_expired( &trust_ca->valid_to ) )
|
||||
if( x509_time_expired( &trust_ca->valid_to ) )
|
||||
ca_flags |= BADCERT_EXPIRED;
|
||||
|
||||
if( NULL != f_vrfy )
|
||||
@@ -1422,7 +1422,7 @@ static int x509parse_verify_child(
|
||||
x509_cert *grandparent;
|
||||
const md_info_t *md_info;
|
||||
|
||||
if( x509parse_time_expired( &child->valid_to ) )
|
||||
if( x509_time_expired( &child->valid_to ) )
|
||||
*flags |= BADCERT_EXPIRED;
|
||||
|
||||
md_info = md_info_from_type( child->sig_md );
|
||||
|
@@ -78,12 +78,12 @@ void x509write_crt_set_issuer_key( x509write_cert *ctx, pk_context *key )
|
||||
|
||||
int x509write_crt_set_subject_name( x509write_cert *ctx, char *subject_name )
|
||||
{
|
||||
return x509write_string_to_names( &ctx->subject, subject_name );
|
||||
return x509_string_to_names( &ctx->subject, subject_name );
|
||||
}
|
||||
|
||||
int x509write_crt_set_issuer_name( x509write_cert *ctx, char *issuer_name )
|
||||
{
|
||||
return x509write_string_to_names( &ctx->issuer, issuer_name );
|
||||
return x509_string_to_names( &ctx->issuer, issuer_name );
|
||||
}
|
||||
|
||||
int x509write_crt_set_serial( x509write_cert *ctx, const mpi *serial )
|
||||
|
@@ -379,7 +379,7 @@ int x509parse_csr_info( char *buf, size_t size, const char *prefix,
|
||||
|
||||
ret = snprintf( p, n, "\n%ssubject name : ", prefix );
|
||||
SAFE_SNPRINTF();
|
||||
ret = x509parse_dn_gets( p, n, &csr->subject );
|
||||
ret = x509_dn_gets( p, n, &csr->subject );
|
||||
SAFE_SNPRINTF();
|
||||
|
||||
ret = snprintf( p, n, "\n%ssigned using : ", prefix );
|
||||
|
@@ -68,7 +68,7 @@ void x509write_csr_set_key( x509write_csr *ctx, pk_context *key )
|
||||
|
||||
int x509write_csr_set_subject_name( x509write_csr *ctx, char *subject_name )
|
||||
{
|
||||
return x509write_string_to_names( &ctx->subject, subject_name );
|
||||
return x509_string_to_names( &ctx->subject, subject_name );
|
||||
}
|
||||
|
||||
int x509write_csr_set_extension( x509write_csr *ctx,
|
||||
|
Reference in New Issue
Block a user