FreeRDP
Test_x509_utils.c File Reference
#include <winpr/file.h>
#include <winpr/string.h>
#include "../x509_utils.h"

Typedefs

typedef char *(* get_field_pr) (const X509 *)
 

Functions

static char * x509_utils_subject_common_name_wo_length (const X509 *xcert)
 
static char * certificate_path (const char *filename)
 
static int TestCertificateFile (const char *certificate_path, const certificate_test_t *ccertificate_tests, size_t count)
 
static int TestSignatureAlgorithm (const signature_alg_test_t *test)
 
int Test_x509_utils (int argc, char *argv[])
 

Variables

static const certificate_test_t certificate_tests []
 
static const signature_alg_test_t signature_alg_tests []
 

Typedef Documentation

◆ get_field_pr

typedef char*(* get_field_pr) (const X509 *)

Function Documentation

◆ certificate_path()

static char* certificate_path ( const char *  filename)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Test_x509_utils()

int Test_x509_utils ( int  argc,
char *  argv[] 
)
Here is the call graph for this function:

◆ TestCertificateFile()

static int TestCertificateFile ( const char *  certificate_path,
const certificate_test_t *  ccertificate_tests,
size_t  count 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestSignatureAlgorithm()

static int TestSignatureAlgorithm ( const signature_alg_test_t *  test)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x509_utils_subject_common_name_wo_length()

static char* x509_utils_subject_common_name_wo_length ( const X509 *  xcert)
static
Here is the call graph for this function:

Variable Documentation

◆ certificate_tests

const certificate_test_t certificate_tests[]
static
Initial value:
= {
{ ENABLED, "Certificate Common Name", x509_utils_subject_common_name_wo_length,
"TESTJEAN TESTMARTIN 9999999" },
{ ENABLED, "Certificate subject", x509_utils_get_subject,
"CN = TESTJEAN TESTMARTIN 9999999, C = FR, O = MINISTERE DES TESTS, OU = 0002 110014016, OU "
"= PERSONNES, UID = 9999999, GN = TESTJEAN, SN = TESTMARTIN" },
{ DISABLED, "Kerberos principal name", 0, "testjean.testmartin@kpn.test.example.com" },
{ ENABLED, "Certificate e-mail", x509_utils_get_email, "testjean.testmartin@test.example.com"
},
{ ENABLED, "Microsoft's Universal Principal Name", x509_utils_get_upn,
"testjean.testmartin.9999999@upn.test.example.com" },
{ ENABLED, "Certificate issuer", x509_utils_get_issuer,
"CN = ADMINISTRATION CENTRALE DES TESTS, C = FR, O = MINISTERE DES TESTS, OU = 0002 "
"110014016" },
}
static char * x509_utils_subject_common_name_wo_length(const X509 *xcert)
Definition: Test_x509_utils.c:18
char * x509_utils_get_email(const X509 *x509)
Definition: x509_utils.c:426
char * x509_utils_get_upn(const X509 *x509)
Definition: x509_utils.c:446
char * x509_utils_get_subject(const X509 *xcert)
Definition: x509_utils.c:103
char * x509_utils_get_issuer(const X509 *xcert)
Definition: x509_utils.c:550

◆ signature_alg_tests

const signature_alg_test_t signature_alg_tests[]
static
Initial value:
= {
{ "rsa_pkcs1_sha1_cert.pem", WINPR_MD_SHA1 },
{ "rsa_pkcs1_sha256_cert.pem", WINPR_MD_SHA256 },
{ "rsa_pkcs1_sha384_cert.pem", WINPR_MD_SHA384 },
{ "rsa_pkcs1_sha512_cert.pem", WINPR_MD_SHA512 },
{ "ecdsa_sha1_cert.pem", WINPR_MD_SHA1 },
{ "ecdsa_sha256_cert.pem", WINPR_MD_SHA256 },
{ "ecdsa_sha384_cert.pem", WINPR_MD_SHA384 },
{ "ecdsa_sha512_cert.pem", WINPR_MD_SHA512 },
{ "rsa_pss_sha1_cert.pem", WINPR_MD_SHA1 },
{ "rsa_pss_sha256_cert.pem", WINPR_MD_SHA256 },
{ "rsa_pss_sha384_cert.pem", WINPR_MD_SHA384 },
{ "rsa_pss_sha512_cert.pem", WINPR_MD_SHA512 },
{ "rsa_pss_sha256_mgf1_sha384_cert.pem", WINPR_MD_NONE },
}
@ WINPR_MD_SHA512
Definition: custom-crypto.h:60
@ WINPR_MD_NONE
Definition: custom-crypto.h:52
@ WINPR_MD_SHA384
Definition: custom-crypto.h:59
@ WINPR_MD_SHA256
Definition: custom-crypto.h:58
@ WINPR_MD_SHA1
Definition: custom-crypto.h:56