@@ -78,7 +78,7 @@ extern "C"
/* Certificate handling functions.
*/
-typedef enum gnutls_certificate_import_flags
+ typedef enum gnutls_certificate_import_flags
{
/* Fail if the certificates in the buffer are more than the space
* allocated for certificates. The error code will be
@@ -87,71 +87,61 @@ typedef enum gnutls_certificate_import_flags
GNUTLS_X509_CRT_LIST_IMPORT_FAIL_IF_EXCEED = 1
} gnutls_certificate_import_flags;
-int gnutls_x509_crt_init(gnutls_x509_crt_t * cert);
-void gnutls_x509_crt_deinit(gnutls_x509_crt_t cert);
-int gnutls_x509_crt_import(gnutls_x509_crt_t cert,
- const gnutls_datum_t * data,
- gnutls_x509_crt_fmt_t format);
-int gnutls_x509_crt_list_import(gnutls_x509_crt_t * certs,
- unsigned int *cert_max,
- const gnutls_datum_t * data,
- gnutls_x509_crt_fmt_t format,
- unsigned int flags);
-int gnutls_x509_crt_export(gnutls_x509_crt_t cert,
- gnutls_x509_crt_fmt_t format,
- void *output_data,
- size_t * output_data_size);
-int gnutls_x509_crt_get_issuer_dn(gnutls_x509_crt_t cert,
- char *buf,
- size_t * sizeof_buf);
-int gnutls_x509_crt_get_issuer_dn_oid(gnutls_x509_crt_t cert,
- int indx,
- void *oid,
- size_t * sizeof_oid);
-int gnutls_x509_crt_get_issuer_dn_by_oid(gnutls_x509_crt_t cert,
- const char *oid,
+ int gnutls_x509_crt_init (gnutls_x509_crt_t * cert);
+ void gnutls_x509_crt_deinit (gnutls_x509_crt_t cert);
+ int gnutls_x509_crt_import (gnutls_x509_crt_t cert,
+ const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+ int gnutls_x509_crt_list_import (gnutls_x509_crt_t * certs,
+ unsigned int *cert_max,
+ const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format,
+ unsigned int flags);
+ int gnutls_x509_crt_export (gnutls_x509_crt_t cert,
+ gnutls_x509_crt_fmt_t format,
+ void *output_data, size_t * output_data_size);
+ int gnutls_x509_crt_get_issuer_dn (gnutls_x509_crt_t cert,
+ char *buf, size_t * sizeof_buf);
+ int gnutls_x509_crt_get_issuer_dn_oid (gnutls_x509_crt_t cert,
int indx,
- unsigned int raw_flag,
- void *buf,
- size_t * sizeof_buf);
-int gnutls_x509_crt_get_dn(gnutls_x509_crt_t cert,
- char *buf,
- size_t * sizeof_buf);
-int gnutls_x509_crt_get_dn_oid(gnutls_x509_crt_t cert,
- int indx,
- void *oid,
- size_t * sizeof_oid);
-int gnutls_x509_crt_get_dn_by_oid(gnutls_x509_crt_t cert,
- const char *oid,
- int indx,
- unsigned int raw_flag,
- void *buf,
- size_t * sizeof_buf);
-int gnutls_x509_crt_check_hostname(gnutls_x509_crt_t cert,
- const char *hostname);
+ void *oid, size_t * sizeof_oid);
+ int gnutls_x509_crt_get_issuer_dn_by_oid (gnutls_x509_crt_t cert,
+ const char *oid,
+ int indx,
+ unsigned int raw_flag,
+ void *buf, size_t * sizeof_buf);
+ int gnutls_x509_crt_get_dn (gnutls_x509_crt_t cert,
+ char *buf, size_t * sizeof_buf);
+ int gnutls_x509_crt_get_dn_oid (gnutls_x509_crt_t cert,
+ int indx, void *oid, size_t * sizeof_oid);
+ int gnutls_x509_crt_get_dn_by_oid (gnutls_x509_crt_t cert,
+ const char *oid,
+ int indx,
+ unsigned int raw_flag,
+ void *buf, size_t * sizeof_buf);
+ int gnutls_x509_crt_check_hostname (gnutls_x509_crt_t cert,
+ const char *hostname);
-int gnutls_x509_crt_get_signature_algorithm(gnutls_x509_crt_t cert);
-int gnutls_x509_crt_get_signature(gnutls_x509_crt_t cert,
- char *sig,
- size_t *sizeof_sig);
-int gnutls_x509_crt_get_version(gnutls_x509_crt_t cert);
-int gnutls_x509_crt_get_key_id(gnutls_x509_crt_t crt,
- unsigned int flags,
- unsigned char *output_data,
- size_t * output_data_size);
+ int gnutls_x509_crt_get_signature_algorithm (gnutls_x509_crt_t cert);
+ int gnutls_x509_crt_get_signature (gnutls_x509_crt_t cert,
+ char *sig, size_t * sizeof_sig);
+ int gnutls_x509_crt_get_version (gnutls_x509_crt_t cert);
+ int gnutls_x509_crt_get_key_id (gnutls_x509_crt_t crt,
+ unsigned int flags,
+ unsigned char *output_data,
+ size_t * output_data_size);
-int gnutls_x509_crt_set_authority_key_id(gnutls_x509_crt_t cert,
- const void *id,
- size_t id_size);
-int gnutls_x509_crt_get_authority_key_id(gnutls_x509_crt_t cert,
- void *ret,
- size_t * ret_size,
- unsigned int *critical);
+ int gnutls_x509_crt_set_authority_key_id (gnutls_x509_crt_t cert,
+ const void *id, size_t id_size);
+ int gnutls_x509_crt_get_authority_key_id (gnutls_x509_crt_t cert,
+ void *ret,
+ size_t * ret_size,
+ unsigned int *critical);
-int gnutls_x509_crt_get_subject_key_id(gnutls_x509_crt_t cert,
- void *ret,
- size_t * ret_size,
- unsigned int *critical);
+ int gnutls_x509_crt_get_subject_key_id (gnutls_x509_crt_t cert,
+ void *ret,
+ size_t * ret_size,
+ unsigned int *critical);
#define GNUTLS_CRL_REASON_UNUSED 128
#define GNUTLS_CRL_REASON_KEY_COMPROMISE 64
@@ -163,336 +153,303 @@ int gnutls_x509_crt_get_subject_key_id(gnutls_x509_crt_t cert,
#define GNUTLS_CRL_REASON_PRIVILEGE_WITHDRAWN 1
#define GNUTLS_CRL_REASON_AA_COMPROMISE 32768
-int gnutls_x509_crt_get_crl_dist_points(gnutls_x509_crt_t cert,
- unsigned int seq,
- void *ret,
- size_t * ret_size,
- unsigned int *reason_flags,
- unsigned int *critical);
-int gnutls_x509_crt_set_crl_dist_points(gnutls_x509_crt_t crt,
- gnutls_x509_subject_alt_name_t
- type,
- const void *data_string,
- unsigned int reason_flags);
-int gnutls_x509_crt_cpy_crl_dist_points(gnutls_x509_crt_t dst,
- gnutls_x509_crt_t src);
+ int gnutls_x509_crt_get_crl_dist_points (gnutls_x509_crt_t cert,
+ unsigned int seq,
+ void *ret,
+ size_t * ret_size,
+ unsigned int *reason_flags,
+ unsigned int *critical);
+ int gnutls_x509_crt_set_crl_dist_points (gnutls_x509_crt_t crt,
+ gnutls_x509_subject_alt_name_t
+ type,
+ const void *data_string,
+ unsigned int reason_flags);
+ int gnutls_x509_crt_cpy_crl_dist_points (gnutls_x509_crt_t dst,
+ gnutls_x509_crt_t src);
-time_t gnutls_x509_crt_get_activation_time(gnutls_x509_crt_t cert);
-time_t gnutls_x509_crt_get_expiration_time(gnutls_x509_crt_t cert);
-int gnutls_x509_crt_get_serial(gnutls_x509_crt_t cert,
- void *result,
- size_t * result_size);
+ time_t gnutls_x509_crt_get_activation_time (gnutls_x509_crt_t cert);
+ time_t gnutls_x509_crt_get_expiration_time (gnutls_x509_crt_t cert);
+ int gnutls_x509_crt_get_serial (gnutls_x509_crt_t cert,
+ void *result, size_t * result_size);
-int gnutls_x509_crt_get_pk_algorithm(gnutls_x509_crt_t cert,
- unsigned int *bits);
-int gnutls_x509_crt_get_pk_rsa_raw(gnutls_x509_crt_t crt,
- gnutls_datum_t * m,
- gnutls_datum_t * e);
-int gnutls_x509_crt_get_pk_dsa_raw(gnutls_x509_crt_t crt,
- gnutls_datum_t * p,
- gnutls_datum_t * q,
- gnutls_datum_t * g,
- gnutls_datum_t * y);
+ int gnutls_x509_crt_get_pk_algorithm (gnutls_x509_crt_t cert,
+ unsigned int *bits);
+ int gnutls_x509_crt_get_pk_rsa_raw (gnutls_x509_crt_t crt,
+ gnutls_datum_t * m, gnutls_datum_t * e);
+ int gnutls_x509_crt_get_pk_dsa_raw (gnutls_x509_crt_t crt,
+ gnutls_datum_t * p,
+ gnutls_datum_t * q,
+ gnutls_datum_t * g, gnutls_datum_t * y);
-int gnutls_x509_crt_get_subject_alt_name(gnutls_x509_crt_t cert,
- unsigned int seq,
- void *ret,
- size_t * ret_size,
- unsigned int *critical);
-int gnutls_x509_crt_get_subject_alt_name2(gnutls_x509_crt_t cert,
- unsigned int seq,
- void *ret,
- size_t * ret_size,
- unsigned int* ret_type,
- unsigned int *critical);
+ int gnutls_x509_crt_get_subject_alt_name (gnutls_x509_crt_t cert,
+ unsigned int seq,
+ void *ret,
+ size_t * ret_size,
+ unsigned int *critical);
+ int gnutls_x509_crt_get_subject_alt_name2 (gnutls_x509_crt_t cert,
+ unsigned int seq,
+ void *ret,
+ size_t * ret_size,
+ unsigned int *ret_type,
+ unsigned int *critical);
-int gnutls_x509_crt_get_subject_alt_othername_oid(gnutls_x509_crt_t cert,
- unsigned int seq,
- void *ret,
- size_t * ret_size);
+ int gnutls_x509_crt_get_subject_alt_othername_oid (gnutls_x509_crt_t cert,
+ unsigned int seq,
+ void *ret,
+ size_t * ret_size);
-int gnutls_x509_crt_get_ca_status(gnutls_x509_crt_t cert,
- unsigned int *critical);
-int gnutls_x509_crt_get_basic_constraints(gnutls_x509_crt_t cert,
- unsigned int *critical,
- int *ca,
- int *pathlen);
+ int gnutls_x509_crt_get_ca_status (gnutls_x509_crt_t cert,
+ unsigned int *critical);
+ int gnutls_x509_crt_get_basic_constraints (gnutls_x509_crt_t cert,
+ unsigned int *critical,
+ int *ca, int *pathlen);
/* The key_usage flags are defined in gnutls.h. They are the
* GNUTLS_KEY_* definitions.
*/
-int gnutls_x509_crt_get_key_usage(gnutls_x509_crt_t cert,
- unsigned int *key_usage,
- unsigned int *critical);
-int gnutls_x509_crt_set_key_usage(gnutls_x509_crt_t crt,
- unsigned int usage);
+ int gnutls_x509_crt_get_key_usage (gnutls_x509_crt_t cert,
+ unsigned int *key_usage,
+ unsigned int *critical);
+ int gnutls_x509_crt_set_key_usage (gnutls_x509_crt_t crt,
+ unsigned int usage);
-int gnutls_x509_crt_get_proxy(gnutls_x509_crt_t cert,
- unsigned int *critical,
- int *pathlen,
- char **policyLanguage,
- char **policy,
- size_t *sizeof_policy);
+ int gnutls_x509_crt_get_proxy (gnutls_x509_crt_t cert,
+ unsigned int *critical,
+ int *pathlen,
+ char **policyLanguage,
+ char **policy, size_t * sizeof_policy);
-int gnutls_x509_dn_oid_known(const char *oid);
+ int gnutls_x509_dn_oid_known (const char *oid);
/* Read extensions by OID. */
-int gnutls_x509_crt_get_extension_oid(gnutls_x509_crt_t cert,
- int indx,
- void *oid,
- size_t * sizeof_oid);
-int gnutls_x509_crt_get_extension_by_oid(gnutls_x509_crt_t cert,
- const char *oid,
+ int gnutls_x509_crt_get_extension_oid (gnutls_x509_crt_t cert,
int indx,
- void *buf,
- size_t * sizeof_buf,
- unsigned int *critical);
+ void *oid, size_t * sizeof_oid);
+ int gnutls_x509_crt_get_extension_by_oid (gnutls_x509_crt_t cert,
+ const char *oid,
+ int indx,
+ void *buf,
+ size_t * sizeof_buf,
+ unsigned int *critical);
/* Read extensions by sequence number. */
-int gnutls_x509_crt_get_extension_info(gnutls_x509_crt_t cert,
- int indx,
- void *oid,
- size_t * sizeof_oid,
- int *critical);
-int gnutls_x509_crt_get_extension_data(gnutls_x509_crt_t cert,
- int indx,
- void *data,
- size_t * sizeof_data);
+ int gnutls_x509_crt_get_extension_info (gnutls_x509_crt_t cert,
+ int indx,
+ void *oid,
+ size_t * sizeof_oid, int *critical);
+ int gnutls_x509_crt_get_extension_data (gnutls_x509_crt_t cert,
+ int indx,
+ void *data, size_t * sizeof_data);
-int gnutls_x509_crt_set_extension_by_oid(gnutls_x509_crt_t crt,
- const char *oid,
- const void *buf,
- size_t sizeof_buf,
- unsigned int critical);
+ int gnutls_x509_crt_set_extension_by_oid (gnutls_x509_crt_t crt,
+ const char *oid,
+ const void *buf,
+ size_t sizeof_buf,
+ unsigned int critical);
/* X.509 Certificate writing.
*/
-int gnutls_x509_crt_set_dn_by_oid(gnutls_x509_crt_t crt,
- const char *oid,
- unsigned int raw_flag,
- const void *name,
- unsigned int sizeof_name);
-int gnutls_x509_crt_set_issuer_dn_by_oid(gnutls_x509_crt_t crt,
- const char *oid,
- unsigned int raw_flag,
- const void *name,
- unsigned int sizeof_name);
-int gnutls_x509_crt_set_version(gnutls_x509_crt_t crt,
- unsigned int version);
-int gnutls_x509_crt_set_key(gnutls_x509_crt_t crt,
- gnutls_x509_privkey_t key);
-int gnutls_x509_crt_set_ca_status(gnutls_x509_crt_t crt,
- unsigned int ca);
-int gnutls_x509_crt_set_basic_constraints(gnutls_x509_crt_t crt,
- unsigned int ca,
- int pathLenConstraint);
-int gnutls_x509_crt_set_subject_alternative_name(gnutls_x509_crt_t crt,
- gnutls_x509_subject_alt_name_t
- type,
- const char *data_string);
-int gnutls_x509_crt_sign(gnutls_x509_crt_t crt,
- gnutls_x509_crt_t issuer,
- gnutls_x509_privkey_t issuer_key);
-int gnutls_x509_crt_sign2(gnutls_x509_crt_t crt,
- gnutls_x509_crt_t issuer,
- gnutls_x509_privkey_t issuer_key,
- enum MHD_GNUTLS_HashAlgorithm,
- unsigned int flags);
-int gnutls_x509_crt_set_activation_time(gnutls_x509_crt_t cert,
- time_t act_time);
-int gnutls_x509_crt_set_expiration_time(gnutls_x509_crt_t cert,
- time_t exp_time);
-int gnutls_x509_crt_set_serial(gnutls_x509_crt_t cert,
- const void *serial,
- size_t serial_size);
+ int gnutls_x509_crt_set_dn_by_oid (gnutls_x509_crt_t crt,
+ const char *oid,
+ unsigned int raw_flag,
+ const void *name,
+ unsigned int sizeof_name);
+ int gnutls_x509_crt_set_issuer_dn_by_oid (gnutls_x509_crt_t crt,
+ const char *oid,
+ unsigned int raw_flag,
+ const void *name,
+ unsigned int sizeof_name);
+ int gnutls_x509_crt_set_version (gnutls_x509_crt_t crt,
+ unsigned int version);
+ int gnutls_x509_crt_set_key (gnutls_x509_crt_t crt,
+ gnutls_x509_privkey_t key);
+ int gnutls_x509_crt_set_ca_status (gnutls_x509_crt_t crt, unsigned int ca);
+ int gnutls_x509_crt_set_basic_constraints (gnutls_x509_crt_t crt,
+ unsigned int ca,
+ int pathLenConstraint);
+ int gnutls_x509_crt_set_subject_alternative_name (gnutls_x509_crt_t crt,
+ gnutls_x509_subject_alt_name_t
+ type,
+ const char *data_string);
+ int gnutls_x509_crt_sign (gnutls_x509_crt_t crt,
+ gnutls_x509_crt_t issuer,
+ gnutls_x509_privkey_t issuer_key);
+ int gnutls_x509_crt_sign2 (gnutls_x509_crt_t crt,
+ gnutls_x509_crt_t issuer,
+ gnutls_x509_privkey_t issuer_key,
+ enum MHD_GNUTLS_HashAlgorithm,
+ unsigned int flags);
+ int gnutls_x509_crt_set_activation_time (gnutls_x509_crt_t cert,
+ time_t act_time);
+ int gnutls_x509_crt_set_expiration_time (gnutls_x509_crt_t cert,
+ time_t exp_time);
+ int gnutls_x509_crt_set_serial (gnutls_x509_crt_t cert,
+ const void *serial, size_t serial_size);
-int gnutls_x509_crt_set_subject_key_id(gnutls_x509_crt_t cert,
- const void *id,
- size_t id_size);
+ int gnutls_x509_crt_set_subject_key_id (gnutls_x509_crt_t cert,
+ const void *id, size_t id_size);
-int gnutls_x509_crt_set_proxy_dn(gnutls_x509_crt_t crt,
- gnutls_x509_crt_t eecrt,
- unsigned int raw_flag,
- const void *name,
- unsigned int sizeof_name);
-int gnutls_x509_crt_set_proxy(gnutls_x509_crt_t crt,
- int pathLenConstraint,
- const char *policyLanguage,
- const char *policy,
- size_t sizeof_policy);
+ int gnutls_x509_crt_set_proxy_dn (gnutls_x509_crt_t crt,
+ gnutls_x509_crt_t eecrt,
+ unsigned int raw_flag,
+ const void *name,
+ unsigned int sizeof_name);
+ int gnutls_x509_crt_set_proxy (gnutls_x509_crt_t crt,
+ int pathLenConstraint,
+ const char *policyLanguage,
+ const char *policy, size_t sizeof_policy);
-typedef enum gnutls_certificate_print_formats
+ typedef enum gnutls_certificate_print_formats
{
GNUTLS_X509_CRT_FULL,
GNUTLS_X509_CRT_ONELINE,
GNUTLS_X509_CRT_UNSIGNED_FULL
} gnutls_certificate_print_formats_t;
-int gnutls_x509_crt_print(gnutls_x509_crt_t cert,
- gnutls_certificate_print_formats_t format,
- gnutls_datum_t *out);
-int gnutls_x509_crl_print(gnutls_x509_crl_t crl,
- gnutls_certificate_print_formats_t format,
- gnutls_datum_t *out);
+ int gnutls_x509_crt_print (gnutls_x509_crt_t cert,
+ gnutls_certificate_print_formats_t format,
+ gnutls_datum_t * out);
+ int gnutls_x509_crl_print (gnutls_x509_crl_t crl,
+ gnutls_certificate_print_formats_t format,
+ gnutls_datum_t * out);
/* Access to internal Certificate fields.
*/
-int gnutls_x509_crt_get_raw_issuer_dn(gnutls_x509_crt_t cert,
- gnutls_datum_t * start);
-int gnutls_x509_crt_get_raw_dn(gnutls_x509_crt_t cert,
- gnutls_datum_t * start);
+ int gnutls_x509_crt_get_raw_issuer_dn (gnutls_x509_crt_t cert,
+ gnutls_datum_t * start);
+ int gnutls_x509_crt_get_raw_dn (gnutls_x509_crt_t cert,
+ gnutls_datum_t * start);
/* RDN handling.
*/
-int gnutls_x509_rdn_get(const gnutls_datum_t * idn,
- char *buf,
- size_t * sizeof_buf);
-int gnutls_x509_rdn_get_oid(const gnutls_datum_t * idn,
- int indx,
- void *buf,
- size_t * sizeof_buf);
+ int gnutls_x509_rdn_get (const gnutls_datum_t * idn,
+ char *buf, size_t * sizeof_buf);
+ int gnutls_x509_rdn_get_oid (const gnutls_datum_t * idn,
+ int indx, void *buf, size_t * sizeof_buf);
-int gnutls_x509_rdn_get_by_oid(const gnutls_datum_t * idn,
- const char *oid,
- int indx,
- unsigned int raw_flag,
- void *buf,
- size_t * sizeof_buf);
+ int gnutls_x509_rdn_get_by_oid (const gnutls_datum_t * idn,
+ const char *oid,
+ int indx,
+ unsigned int raw_flag,
+ void *buf, size_t * sizeof_buf);
-typedef void *gnutls_x509_dn_t;
+ typedef void *gnutls_x509_dn_t;
-typedef struct gnutls_x509_ava_st
+ typedef struct gnutls_x509_ava_st
{
gnutls_datum_t oid;
gnutls_datum_t value;
unsigned long value_tag;
} gnutls_x509_ava_st;
-int gnutls_x509_crt_get_subject(gnutls_x509_crt_t cert,
- gnutls_x509_dn_t *dn);
-int gnutls_x509_crt_get_issuer(gnutls_x509_crt_t cert,
- gnutls_x509_dn_t *dn);
-int gnutls_x509_dn_get_rdn_ava(gnutls_x509_dn_t dn,
- int irdn,
- int iava,
- gnutls_x509_ava_st *avast);
+ int gnutls_x509_crt_get_subject (gnutls_x509_crt_t cert,
+ gnutls_x509_dn_t * dn);
+ int gnutls_x509_crt_get_issuer (gnutls_x509_crt_t cert,
+ gnutls_x509_dn_t * dn);
+ int gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
+ int irdn,
+ int iava, gnutls_x509_ava_st * avast);
/* CRL handling functions.
*/
-int gnutls_x509_crl_init(gnutls_x509_crl_t * crl);
-void gnutls_x509_crl_deinit(gnutls_x509_crl_t crl);
+ int gnutls_x509_crl_init (gnutls_x509_crl_t * crl);
+ void gnutls_x509_crl_deinit (gnutls_x509_crl_t crl);
-int gnutls_x509_crl_import(gnutls_x509_crl_t crl,
- const gnutls_datum_t * data,
- gnutls_x509_crt_fmt_t format);
-int gnutls_x509_crl_export(gnutls_x509_crl_t crl,
- gnutls_x509_crt_fmt_t format,
- void *output_data,
- size_t * output_data_size);
+ int gnutls_x509_crl_import (gnutls_x509_crl_t crl,
+ const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+ int gnutls_x509_crl_export (gnutls_x509_crl_t crl,
+ gnutls_x509_crt_fmt_t format,
+ void *output_data, size_t * output_data_size);
-int gnutls_x509_crl_get_issuer_dn(const gnutls_x509_crl_t crl,
- char *buf,
- size_t * sizeof_buf);
-int gnutls_x509_crl_get_issuer_dn_by_oid(gnutls_x509_crl_t crl,
- const char *oid,
- int indx,
- unsigned int raw_flag,
- void *buf,
- size_t * sizeof_buf);
-int gnutls_x509_crl_get_dn_oid(gnutls_x509_crl_t crl,
- int indx,
- void *oid,
- size_t * sizeof_oid);
+ int gnutls_x509_crl_get_issuer_dn (const gnutls_x509_crl_t crl,
+ char *buf, size_t * sizeof_buf);
+ int gnutls_x509_crl_get_issuer_dn_by_oid (gnutls_x509_crl_t crl,
+ const char *oid,
+ int indx,
+ unsigned int raw_flag,
+ void *buf, size_t * sizeof_buf);
+ int gnutls_x509_crl_get_dn_oid (gnutls_x509_crl_t crl,
+ int indx, void *oid, size_t * sizeof_oid);
-int gnutls_x509_crl_get_signature_algorithm(gnutls_x509_crl_t crl);
-int gnutls_x509_crl_get_signature(gnutls_x509_crl_t crl,
- char *sig,
- size_t *sizeof_sig);
-int gnutls_x509_crl_get_version(gnutls_x509_crl_t crl);
+ int gnutls_x509_crl_get_signature_algorithm (gnutls_x509_crl_t crl);
+ int gnutls_x509_crl_get_signature (gnutls_x509_crl_t crl,
+ char *sig, size_t * sizeof_sig);
+ int gnutls_x509_crl_get_version (gnutls_x509_crl_t crl);
-time_t gnutls_x509_crl_get_this_update(gnutls_x509_crl_t crl);
-time_t gnutls_x509_crl_get_next_update(gnutls_x509_crl_t crl);
+ time_t gnutls_x509_crl_get_this_update (gnutls_x509_crl_t crl);
+ time_t gnutls_x509_crl_get_next_update (gnutls_x509_crl_t crl);
-int gnutls_x509_crl_get_crt_count(gnutls_x509_crl_t crl);
-int gnutls_x509_crl_get_crt_serial(gnutls_x509_crl_t crl,
- int indx,
- unsigned char *serial,
- size_t * serial_size,
- time_t * t);
+ int gnutls_x509_crl_get_crt_count (gnutls_x509_crl_t crl);
+ int gnutls_x509_crl_get_crt_serial (gnutls_x509_crl_t crl,
+ int indx,
+ unsigned char *serial,
+ size_t * serial_size, time_t * t);
#define gnutls_x509_crl_get_certificate_count gnutls_x509_crl_get_crt_count
#define gnutls_x509_crl_get_certificate gnutls_x509_crl_get_crt_serial
-int gnutls_x509_crl_check_issuer(gnutls_x509_crl_t crl,
- gnutls_x509_crt_t issuer);
+ int gnutls_x509_crl_check_issuer (gnutls_x509_crl_t crl,
+ gnutls_x509_crt_t issuer);
/* CRL writing.
*/
-int gnutls_x509_crl_set_version(gnutls_x509_crl_t crl,
- unsigned int version);
-int gnutls_x509_crl_sign(gnutls_x509_crl_t crl,
- gnutls_x509_crt_t issuer,
- gnutls_x509_privkey_t issuer_key);
-int gnutls_x509_crl_sign2(gnutls_x509_crl_t crl,
- gnutls_x509_crt_t issuer,
- gnutls_x509_privkey_t issuer_key,
- enum MHD_GNUTLS_HashAlgorithm,
- unsigned int flags);
-int gnutls_x509_crl_set_this_update(gnutls_x509_crl_t crl,
- time_t act_time);
-int gnutls_x509_crl_set_next_update(gnutls_x509_crl_t crl,
- time_t exp_time);
-int gnutls_x509_crl_set_crt_serial(gnutls_x509_crl_t crl,
- const void *serial,
- size_t serial_size,
- time_t revocation_time);
-int gnutls_x509_crl_set_crt(gnutls_x509_crl_t crl,
- gnutls_x509_crt_t crt,
- time_t revocation_time);
+ int gnutls_x509_crl_set_version (gnutls_x509_crl_t crl,
+ unsigned int version);
+ int gnutls_x509_crl_sign (gnutls_x509_crl_t crl,
+ gnutls_x509_crt_t issuer,
+ gnutls_x509_privkey_t issuer_key);
+ int gnutls_x509_crl_sign2 (gnutls_x509_crl_t crl,
+ gnutls_x509_crt_t issuer,
+ gnutls_x509_privkey_t issuer_key,
+ enum MHD_GNUTLS_HashAlgorithm,
+ unsigned int flags);
+ int gnutls_x509_crl_set_this_update (gnutls_x509_crl_t crl,
+ time_t act_time);
+ int gnutls_x509_crl_set_next_update (gnutls_x509_crl_t crl,
+ time_t exp_time);
+ int gnutls_x509_crl_set_crt_serial (gnutls_x509_crl_t crl,
+ const void *serial,
+ size_t serial_size,
+ time_t revocation_time);
+ int gnutls_x509_crl_set_crt (gnutls_x509_crl_t crl,
+ gnutls_x509_crt_t crt, time_t revocation_time);
/* PKCS7 structures handling
*/
-struct gnutls_pkcs7_int;
-typedef struct gnutls_pkcs7_int *gnutls_pkcs7_t;
+ struct gnutls_pkcs7_int;
+ typedef struct gnutls_pkcs7_int *gnutls_pkcs7_t;
-int gnutls_pkcs7_init(gnutls_pkcs7_t * pkcs7);
-void gnutls_pkcs7_deinit(gnutls_pkcs7_t pkcs7);
-int gnutls_pkcs7_import(gnutls_pkcs7_t pkcs7,
- const gnutls_datum_t * data,
- gnutls_x509_crt_fmt_t format);
-int gnutls_pkcs7_export(gnutls_pkcs7_t pkcs7,
- gnutls_x509_crt_fmt_t format,
- void *output_data,
- size_t * output_data_size);
+ int gnutls_pkcs7_init (gnutls_pkcs7_t * pkcs7);
+ void gnutls_pkcs7_deinit (gnutls_pkcs7_t pkcs7);
+ int gnutls_pkcs7_import (gnutls_pkcs7_t pkcs7,
+ const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+ int gnutls_pkcs7_export (gnutls_pkcs7_t pkcs7,
+ gnutls_x509_crt_fmt_t format,
+ void *output_data, size_t * output_data_size);
-int gnutls_pkcs7_get_crt_count(gnutls_pkcs7_t pkcs7);
-int gnutls_pkcs7_get_crt_raw(gnutls_pkcs7_t pkcs7,
- int indx,
- void *certificate,
- size_t * certificate_size);
+ int gnutls_pkcs7_get_crt_count (gnutls_pkcs7_t pkcs7);
+ int gnutls_pkcs7_get_crt_raw (gnutls_pkcs7_t pkcs7,
+ int indx,
+ void *certificate, size_t * certificate_size);
-int gnutls_pkcs7_set_crt_raw(gnutls_pkcs7_t pkcs7,
- const gnutls_datum_t * crt);
-int gnutls_pkcs7_set_crt(gnutls_pkcs7_t pkcs7,
- gnutls_x509_crt_t crt);
-int gnutls_pkcs7_delete_crt(gnutls_pkcs7_t pkcs7,
- int indx);
+ int gnutls_pkcs7_set_crt_raw (gnutls_pkcs7_t pkcs7,
+ const gnutls_datum_t * crt);
+ int gnutls_pkcs7_set_crt (gnutls_pkcs7_t pkcs7, gnutls_x509_crt_t crt);
+ int gnutls_pkcs7_delete_crt (gnutls_pkcs7_t pkcs7, int indx);
-int gnutls_pkcs7_get_crl_raw(gnutls_pkcs7_t pkcs7,
- int indx,
- void *crl,
- size_t * crl_size);
-int gnutls_pkcs7_get_crl_count(gnutls_pkcs7_t pkcs7);
+ int gnutls_pkcs7_get_crl_raw (gnutls_pkcs7_t pkcs7,
+ int indx, void *crl, size_t * crl_size);
+ int gnutls_pkcs7_get_crl_count (gnutls_pkcs7_t pkcs7);
-int gnutls_pkcs7_set_crl_raw(gnutls_pkcs7_t pkcs7,
- const gnutls_datum_t * crt);
-int gnutls_pkcs7_set_crl(gnutls_pkcs7_t pkcs7,
- gnutls_x509_crl_t crl);
-int gnutls_pkcs7_delete_crl(gnutls_pkcs7_t pkcs7,
- int indx);
+ int gnutls_pkcs7_set_crl_raw (gnutls_pkcs7_t pkcs7,
+ const gnutls_datum_t * crt);
+ int gnutls_pkcs7_set_crl (gnutls_pkcs7_t pkcs7, gnutls_x509_crl_t crl);
+ int gnutls_pkcs7_delete_crl (gnutls_pkcs7_t pkcs7, int indx);
/* X.509 Certificate verification functions.
*/
-typedef enum gnutls_certificate_verify_flags
+ typedef enum gnutls_certificate_verify_flags
{
/* If set a signer does not have to be a certificate authority. This
* flag should normaly be disabled, unless you know what this means.
@@ -527,58 +484,53 @@ typedef enum gnutls_certificate_verify_flags
GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5 = 32
} gnutls_certificate_verify_flags;
-int gnutls_x509_crt_check_issuer(gnutls_x509_crt_t cert,
- gnutls_x509_crt_t issuer);
+ int gnutls_x509_crt_check_issuer (gnutls_x509_crt_t cert,
+ gnutls_x509_crt_t issuer);
-int gnutls_x509_crt_list_verify(const gnutls_x509_crt_t * cert_list,
- int cert_list_length,
- const gnutls_x509_crt_t * CA_list,
- int CA_list_length,
- const gnutls_x509_crl_t * CRL_list,
- int CRL_list_length,
- unsigned int flags,
- unsigned int *verify);
+ int gnutls_x509_crt_list_verify (const gnutls_x509_crt_t * cert_list,
+ int cert_list_length,
+ const gnutls_x509_crt_t * CA_list,
+ int CA_list_length,
+ const gnutls_x509_crl_t * CRL_list,
+ int CRL_list_length,
+ unsigned int flags, unsigned int *verify);
-int gnutls_x509_crt_verify(gnutls_x509_crt_t cert,
- const gnutls_x509_crt_t * CA_list,
- int CA_list_length,
- unsigned int flags,
- unsigned int *verify);
-int gnutls_x509_crl_verify(gnutls_x509_crl_t crl,
- const gnutls_x509_crt_t * CA_list,
- int CA_list_length,
- unsigned int flags,
- unsigned int *verify);
+ int gnutls_x509_crt_verify (gnutls_x509_crt_t cert,
+ const gnutls_x509_crt_t * CA_list,
+ int CA_list_length,
+ unsigned int flags, unsigned int *verify);
+ int gnutls_x509_crl_verify (gnutls_x509_crl_t crl,
+ const gnutls_x509_crt_t * CA_list,
+ int CA_list_length,
+ unsigned int flags, unsigned int *verify);
-int gnutls_x509_crt_check_revocation(gnutls_x509_crt_t cert,
- const gnutls_x509_crl_t *
- crl_list,
- int crl_list_length);
+ int gnutls_x509_crt_check_revocation (gnutls_x509_crt_t cert,
+ const gnutls_x509_crl_t *
+ crl_list, int crl_list_length);
-int gnutls_x509_crt_get_fingerprint(gnutls_x509_crt_t cert,
- enum MHD_GNUTLS_HashAlgorithm algo,
- void *buf,
- size_t * sizeof_buf);
+ int gnutls_x509_crt_get_fingerprint (gnutls_x509_crt_t cert,
+ enum MHD_GNUTLS_HashAlgorithm algo,
+ void *buf, size_t * sizeof_buf);
-int gnutls_x509_crt_get_key_purpose_oid(gnutls_x509_crt_t cert,
- int indx,
- void *oid,
- size_t * sizeof_oid,
- unsigned int *critical);
-int gnutls_x509_crt_set_key_purpose_oid(gnutls_x509_crt_t cert,
- const void *oid,
- unsigned int critical);
+ int gnutls_x509_crt_get_key_purpose_oid (gnutls_x509_crt_t cert,
+ int indx,
+ void *oid,
+ size_t * sizeof_oid,
+ unsigned int *critical);
+ int gnutls_x509_crt_set_key_purpose_oid (gnutls_x509_crt_t cert,
+ const void *oid,
+ unsigned int critical);
/* Private key handling.
*/
/* Flags for the gnutls_x509_privkey_export_pkcs8() function.
*/
-typedef enum gnutls_pkcs_encrypt_flags_t
+ typedef enum gnutls_pkcs_encrypt_flags_t
{
- GNUTLS_PKCS_PLAIN = 1, /* if set the private key will not
- * be encrypted.
- */
+ GNUTLS_PKCS_PLAIN = 1, /* if set the private key will not
+ * be encrypted.
+ */
GNUTLS_PKCS_USE_PKCS12_3DES = 2,
GNUTLS_PKCS_USE_PKCS12_ARCFOUR = 4,
GNUTLS_PKCS_USE_PKCS12_RC2_40 = 8,
@@ -590,154 +542,143 @@ typedef enum gnutls_pkcs_encrypt_flags_t
#define GNUTLS_PKCS8_USE_PKCS12_ARCFOUR GNUTLS_PKCS_USE_PKCS12_ARCFOUR
#define GNUTLS_PKCS8_USE_PKCS12_RC2_40 GNUTLS_PKCS_USE_PKCS12_RC2_40
-int gnutls_x509_privkey_init(gnutls_x509_privkey_t * key);
-void gnutls_x509_privkey_deinit(gnutls_x509_privkey_t key);
-int gnutls_x509_privkey_cpy(gnutls_x509_privkey_t dst,
- gnutls_x509_privkey_t src);
-int gnutls_x509_privkey_import(gnutls_x509_privkey_t key,
- const gnutls_datum_t * data,
- gnutls_x509_crt_fmt_t format);
-int gnutls_x509_privkey_import_pkcs8(gnutls_x509_privkey_t key,
- const gnutls_datum_t * data,
- gnutls_x509_crt_fmt_t format,
- const char *pass,
- unsigned int flags);
-int gnutls_x509_privkey_import_rsa_raw(gnutls_x509_privkey_t key,
- const gnutls_datum_t * m,
- const gnutls_datum_t * e,
- const gnutls_datum_t * d,
- const gnutls_datum_t * p,
- const gnutls_datum_t * q,
- const gnutls_datum_t * u);
-int gnutls_x509_privkey_fix(gnutls_x509_privkey_t key);
+ int gnutls_x509_privkey_init (gnutls_x509_privkey_t * key);
+ void gnutls_x509_privkey_deinit (gnutls_x509_privkey_t key);
+ int gnutls_x509_privkey_cpy (gnutls_x509_privkey_t dst,
+ gnutls_x509_privkey_t src);
+ int gnutls_x509_privkey_import (gnutls_x509_privkey_t key,
+ const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+ int gnutls_x509_privkey_import_pkcs8 (gnutls_x509_privkey_t key,
+ const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format,
+ const char *pass, unsigned int flags);
+ int gnutls_x509_privkey_import_rsa_raw (gnutls_x509_privkey_t key,
+ const gnutls_datum_t * m,
+ const gnutls_datum_t * e,
+ const gnutls_datum_t * d,
+ const gnutls_datum_t * p,
+ const gnutls_datum_t * q,
+ const gnutls_datum_t * u);
+ int gnutls_x509_privkey_fix (gnutls_x509_privkey_t key);
-int gnutls_x509_privkey_export_dsa_raw(gnutls_x509_privkey_t key,
- gnutls_datum_t * p,
- gnutls_datum_t * q,
- gnutls_datum_t * g,
- gnutls_datum_t * y,
- gnutls_datum_t * x);
-int gnutls_x509_privkey_import_dsa_raw(gnutls_x509_privkey_t key,
- const gnutls_datum_t * p,
- const gnutls_datum_t * q,
- const gnutls_datum_t * g,
- const gnutls_datum_t * y,
- const gnutls_datum_t * x);
+ int gnutls_x509_privkey_export_dsa_raw (gnutls_x509_privkey_t key,
+ gnutls_datum_t * p,
+ gnutls_datum_t * q,
+ gnutls_datum_t * g,
+ gnutls_datum_t * y,
+ gnutls_datum_t * x);
+ int gnutls_x509_privkey_import_dsa_raw (gnutls_x509_privkey_t key,
+ const gnutls_datum_t * p,
+ const gnutls_datum_t * q,
+ const gnutls_datum_t * g,
+ const gnutls_datum_t * y,
+ const gnutls_datum_t * x);
-int gnutls_x509_privkey_get_pk_algorithm(gnutls_x509_privkey_t key);
-int gnutls_x509_privkey_get_key_id(gnutls_x509_privkey_t key,
- unsigned int flags,
- unsigned char *output_data,
- size_t * output_data_size);
+ int gnutls_x509_privkey_get_pk_algorithm (gnutls_x509_privkey_t key);
+ int gnutls_x509_privkey_get_key_id (gnutls_x509_privkey_t key,
+ unsigned int flags,
+ unsigned char *output_data,
+ size_t * output_data_size);
-int gnutls_x509_privkey_generate(gnutls_x509_privkey_t key,
- enum MHD_GNUTLS_PublicKeyAlgorithm algo,
- unsigned int bits,
- unsigned int flags);
+ int gnutls_x509_privkey_generate (gnutls_x509_privkey_t key,
+ enum MHD_GNUTLS_PublicKeyAlgorithm algo,
+ unsigned int bits, unsigned int flags);
-int gnutls_x509_privkey_export(gnutls_x509_privkey_t key,
- gnutls_x509_crt_fmt_t format,
- void *output_data,
- size_t * output_data_size);
-int gnutls_x509_privkey_export_pkcs8(gnutls_x509_privkey_t key,
- gnutls_x509_crt_fmt_t format,
- const char *password,
- unsigned int flags,
- void *output_data,
- size_t * output_data_size);
-int gnutls_x509_privkey_export_rsa_raw(gnutls_x509_privkey_t key,
- gnutls_datum_t * m,
- gnutls_datum_t * e,
- gnutls_datum_t * d,
- gnutls_datum_t * p,
- gnutls_datum_t * q,
- gnutls_datum_t * u);
+ int gnutls_x509_privkey_export (gnutls_x509_privkey_t key,
+ gnutls_x509_crt_fmt_t format,
+ void *output_data,
+ size_t * output_data_size);
+ int gnutls_x509_privkey_export_pkcs8 (gnutls_x509_privkey_t key,
+ gnutls_x509_crt_fmt_t format,
+ const char *password,
+ unsigned int flags,
+ void *output_data,
+ size_t * output_data_size);
+ int gnutls_x509_privkey_export_rsa_raw (gnutls_x509_privkey_t key,
+ gnutls_datum_t * m,
+ gnutls_datum_t * e,
+ gnutls_datum_t * d,
+ gnutls_datum_t * p,
+ gnutls_datum_t * q,
+ gnutls_datum_t * u);
/* Signing stuff.
*/
-int gnutls_x509_privkey_sign_data(gnutls_x509_privkey_t key,
- enum MHD_GNUTLS_HashAlgorithm digest,
- unsigned int flags,
- const gnutls_datum_t * data,
- void *signature,
- size_t * signature_size);
-int gnutls_x509_privkey_verify_data(gnutls_x509_privkey_t key,
- unsigned int flags,
- const gnutls_datum_t * data,
- const gnutls_datum_t * signature);
-int gnutls_x509_crt_verify_data(gnutls_x509_crt_t crt,
- unsigned int flags,
- const gnutls_datum_t * data,
- const gnutls_datum_t * signature);
+ int gnutls_x509_privkey_sign_data (gnutls_x509_privkey_t key,
+ enum MHD_GNUTLS_HashAlgorithm digest,
+ unsigned int flags,
+ const gnutls_datum_t * data,
+ void *signature,
+ size_t * signature_size);
+ int gnutls_x509_privkey_verify_data (gnutls_x509_privkey_t key,
+ unsigned int flags,
+ const gnutls_datum_t * data,
+ const gnutls_datum_t * signature);
+ int gnutls_x509_crt_verify_data (gnutls_x509_crt_t crt,
+ unsigned int flags,
+ const gnutls_datum_t * data,
+ const gnutls_datum_t * signature);
-int gnutls_x509_privkey_sign_hash(gnutls_x509_privkey_t key,
- const gnutls_datum_t * hash,
- gnutls_datum_t * signature);
+ int gnutls_x509_privkey_sign_hash (gnutls_x509_privkey_t key,
+ const gnutls_datum_t * hash,
+ gnutls_datum_t * signature);
/* Certificate request stuff.
*/
-struct gnutls_x509_crq_int;
-typedef struct gnutls_x509_crq_int *gnutls_x509_crq_t;
+ struct gnutls_x509_crq_int;
+ typedef struct gnutls_x509_crq_int *gnutls_x509_crq_t;
-int gnutls_x509_crq_init(gnutls_x509_crq_t * crq);
-void gnutls_x509_crq_deinit(gnutls_x509_crq_t crq);
-int gnutls_x509_crq_import(gnutls_x509_crq_t crq,
- const gnutls_datum_t * data,
- gnutls_x509_crt_fmt_t format);
-int gnutls_x509_crq_get_pk_algorithm(gnutls_x509_crq_t crq,
- unsigned int *bits);
-int gnutls_x509_crq_get_dn(gnutls_x509_crq_t crq,
- char *buf,
- size_t * sizeof_buf);
-int gnutls_x509_crq_get_dn_oid(gnutls_x509_crq_t crq,
- int indx,
- void *oid,
- size_t * sizeof_oid);
-int gnutls_x509_crq_get_dn_by_oid(gnutls_x509_crq_t crq,
- const char *oid,
- int indx,
- unsigned int raw_flag,
- void *buf,
- size_t * sizeof_buf);
-int gnutls_x509_crq_set_dn_by_oid(gnutls_x509_crq_t crq,
- const char *oid,
- unsigned int raw_flag,
- const void *name,
- unsigned int sizeof_name);
-int gnutls_x509_crq_set_version(gnutls_x509_crq_t crq,
- unsigned int version);
-int gnutls_x509_crq_set_key(gnutls_x509_crq_t crq,
- gnutls_x509_privkey_t key);
-int gnutls_x509_crq_sign2(gnutls_x509_crq_t crq,
- gnutls_x509_privkey_t key,
- enum MHD_GNUTLS_HashAlgorithm,
- unsigned int flags);
-int gnutls_x509_crq_sign(gnutls_x509_crq_t crq,
- gnutls_x509_privkey_t key);
+ int gnutls_x509_crq_init (gnutls_x509_crq_t * crq);
+ void gnutls_x509_crq_deinit (gnutls_x509_crq_t crq);
+ int gnutls_x509_crq_import (gnutls_x509_crq_t crq,
+ const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+ int gnutls_x509_crq_get_pk_algorithm (gnutls_x509_crq_t crq,
+ unsigned int *bits);
+ int gnutls_x509_crq_get_dn (gnutls_x509_crq_t crq,
+ char *buf, size_t * sizeof_buf);
+ int gnutls_x509_crq_get_dn_oid (gnutls_x509_crq_t crq,
+ int indx, void *oid, size_t * sizeof_oid);
+ int gnutls_x509_crq_get_dn_by_oid (gnutls_x509_crq_t crq,
+ const char *oid,
+ int indx,
+ unsigned int raw_flag,
+ void *buf, size_t * sizeof_buf);
+ int gnutls_x509_crq_set_dn_by_oid (gnutls_x509_crq_t crq,
+ const char *oid,
+ unsigned int raw_flag,
+ const void *name,
+ unsigned int sizeof_name);
+ int gnutls_x509_crq_set_version (gnutls_x509_crq_t crq,
+ unsigned int version);
+ int gnutls_x509_crq_set_key (gnutls_x509_crq_t crq,
+ gnutls_x509_privkey_t key);
+ int gnutls_x509_crq_sign2 (gnutls_x509_crq_t crq,
+ gnutls_x509_privkey_t key,
+ enum MHD_GNUTLS_HashAlgorithm,
+ unsigned int flags);
+ int gnutls_x509_crq_sign (gnutls_x509_crq_t crq, gnutls_x509_privkey_t key);
-int gnutls_x509_crq_set_challenge_password(gnutls_x509_crq_t crq,
- const char *pass);
-int gnutls_x509_crq_get_challenge_password(gnutls_x509_crq_t crq,
- char *pass,
- size_t * sizeof_pass);
+ int gnutls_x509_crq_set_challenge_password (gnutls_x509_crq_t crq,
+ const char *pass);
+ int gnutls_x509_crq_get_challenge_password (gnutls_x509_crq_t crq,
+ char *pass,
+ size_t * sizeof_pass);
-int gnutls_x509_crq_set_attribute_by_oid(gnutls_x509_crq_t crq,
- const char *oid,
- void *buf,
- size_t sizeof_buf);
-int gnutls_x509_crq_get_attribute_by_oid(gnutls_x509_crq_t crq,
- const char *oid,
- int indx,
- void *buf,
- size_t * sizeof_buf);
+ int gnutls_x509_crq_set_attribute_by_oid (gnutls_x509_crq_t crq,
+ const char *oid,
+ void *buf, size_t sizeof_buf);
+ int gnutls_x509_crq_get_attribute_by_oid (gnutls_x509_crq_t crq,
+ const char *oid,
+ int indx,
+ void *buf, size_t * sizeof_buf);
-int gnutls_x509_crq_export(gnutls_x509_crq_t crq,
- gnutls_x509_crt_fmt_t format,
- void *output_data,
- size_t * output_data_size);
+ int gnutls_x509_crq_export (gnutls_x509_crq_t crq,
+ gnutls_x509_crt_fmt_t format,
+ void *output_data, size_t * output_data_size);
-int gnutls_x509_crt_set_crq(gnutls_x509_crt_t crt,
- gnutls_x509_crq_t crq);
+ int gnutls_x509_crt_set_crq (gnutls_x509_crt_t crt, gnutls_x509_crq_t crq);
#ifdef __cplusplus
}
@@ -752,17 +693,17 @@ int gnutls_x509_crt_set_crq(gnutls_x509_crt_t crt,
#define HASH_OID_SHA512 "2.16.840.1.101.3.4.2.3"
typedef struct gnutls_x509_crl_int
- {
- ASN1_TYPE crl;
- } gnutls_x509_crl_int;
+{
+ ASN1_TYPE crl;
+} gnutls_x509_crl_int;
typedef struct gnutls_x509_crt_int
- {
- ASN1_TYPE cert;
- int use_extensions;
- } gnutls_x509_crt_int;
+{
+ ASN1_TYPE cert;
+ int use_extensions;
+} gnutls_x509_crt_int;
-#define MAX_PRIV_PARAMS_SIZE 6 /* ok for RSA and DSA */
+#define MAX_PRIV_PARAMS_SIZE 6 /* ok for RSA and DSA */
/* parameters should not be larger than this limit */
#define DSA_PRIVATE_PARAMS 5
@@ -779,140 +720,130 @@ typedef struct gnutls_x509_crt_int
#endif
typedef struct MHD_gtls_x509_privkey_int
- {
- mpi_t params[MAX_PRIV_PARAMS_SIZE]; /* the size of params depends on the public
- * key algorithm
- */
- /*
- * RSA: [0] is modulus
- * [1] is public exponent
- * [2] is private exponent
- * [3] is prime1 (p)
- * [4] is prime2 (q)
- * [5] is coefficient (u == inverse of p mod q)
- * note that other packages used inverse of q mod p,
- * so we need to perform conversions.
- * DSA: [0] is p
- * [1] is q
- * [2] is g
- * [3] is y (public key)
- * [4] is x (private key)
- */
- int params_size; /* holds the number of params */
+{
+ mpi_t params[MAX_PRIV_PARAMS_SIZE]; /* the size of params depends on the public
+ * key algorithm
+ */
+ /*
+ * RSA: [0] is modulus
+ * [1] is public exponent
+ * [2] is private exponent
+ * [3] is prime1 (p)
+ * [4] is prime2 (q)
+ * [5] is coefficient (u == inverse of p mod q)
+ * note that other packages used inverse of q mod p,
+ * so we need to perform conversions.
+ * DSA: [0] is p
+ * [1] is q
+ * [2] is g
+ * [3] is y (public key)
+ * [4] is x (private key)
+ */
+ int params_size; /* holds the number of params */
- enum MHD_GNUTLS_PublicKeyAlgorithm pk_algorithm;
+ enum MHD_GNUTLS_PublicKeyAlgorithm pk_algorithm;
- int crippled; /* The crippled keys will not use the ASN1_TYPE key.
- * The encoding will only be performed at the export
- * phase, to optimize copying etc. Cannot be used with
- * the exported API (used internally only).
- */
- ASN1_TYPE key;
- } gnutls_x509_privkey_int;
+ int crippled; /* The crippled keys will not use the ASN1_TYPE key.
+ * The encoding will only be performed at the export
+ * phase, to optimize copying etc. Cannot be used with
+ * the exported API (used internally only).
+ */
+ ASN1_TYPE key;
+} gnutls_x509_privkey_int;
-int gnutls_x509_crt_get_issuer_dn_by_oid(gnutls_x509_crt_t cert,
- const char *oid,
- int indx,
- unsigned int raw_flag,
- void *buf,
- size_t * sizeof_buf);
-int gnutls_x509_crt_get_subject_alt_name(gnutls_x509_crt_t cert,
- unsigned int seq,
- void *ret,
- size_t * ret_size,
- unsigned int *critical);
-int gnutls_x509_crt_get_dn_by_oid(gnutls_x509_crt_t cert,
- const char *oid,
- int indx,
- unsigned int raw_flag,
- void *buf,
- size_t * sizeof_buf);
-int gnutls_x509_crt_get_ca_status(gnutls_x509_crt_t cert,
- unsigned int *critical);
-int gnutls_x509_crt_get_pk_algorithm(gnutls_x509_crt_t cert,
- unsigned int *bits);
-
-int _gnutls_x509_crt_cpy(gnutls_x509_crt_t dest,
- gnutls_x509_crt_t src);
-
-int gnutls_x509_crt_get_serial(gnutls_x509_crt_t cert,
- void *result,
- size_t * result_size);
-
-int _gnutls_x509_compare_raw_dn(const gnutls_datum_t * dn1,
- const gnutls_datum_t * dn2);
-
-int gnutls_x509_crt_check_revocation(gnutls_x509_crt_t cert,
- const gnutls_x509_crl_t * crl_list,
- int crl_list_length);
-
-int _gnutls_x509_crl_cpy(gnutls_x509_crl_t dest,
- gnutls_x509_crl_t src);
-int _gnutls_x509_crl_get_raw_issuer_dn(gnutls_x509_crl_t crl,
- gnutls_datum_t * dn);
-int gnutls_x509_crl_get_crt_count(gnutls_x509_crl_t crl);
-int gnutls_x509_crl_get_crt_serial(gnutls_x509_crl_t crl,
+int gnutls_x509_crt_get_issuer_dn_by_oid (gnutls_x509_crt_t cert,
+ const char *oid,
+ int indx,
+ unsigned int raw_flag,
+ void *buf, size_t * sizeof_buf);
+int gnutls_x509_crt_get_subject_alt_name (gnutls_x509_crt_t cert,
+ unsigned int seq,
+ void *ret,
+ size_t * ret_size,
+ unsigned int *critical);
+int gnutls_x509_crt_get_dn_by_oid (gnutls_x509_crt_t cert,
+ const char *oid,
int indx,
- unsigned char *serial,
- size_t * serial_size,
- time_t * t);
+ unsigned int raw_flag,
+ void *buf, size_t * sizeof_buf);
+int gnutls_x509_crt_get_ca_status (gnutls_x509_crt_t cert,
+ unsigned int *critical);
+int gnutls_x509_crt_get_pk_algorithm (gnutls_x509_crt_t cert,
+ unsigned int *bits);
-void gnutls_x509_crl_deinit(gnutls_x509_crl_t crl);
-int gnutls_x509_crl_init(gnutls_x509_crl_t * crl);
-int gnutls_x509_crl_import(gnutls_x509_crl_t crl,
- const gnutls_datum_t * data,
- gnutls_x509_crt_fmt_t format);
-int gnutls_x509_crl_export(gnutls_x509_crl_t crl,
- gnutls_x509_crt_fmt_t format,
- void *output_data,
- size_t * output_data_size);
+int _gnutls_x509_crt_cpy (gnutls_x509_crt_t dest, gnutls_x509_crt_t src);
-int gnutls_x509_crt_init(gnutls_x509_crt_t * cert);
-void gnutls_x509_crt_deinit(gnutls_x509_crt_t cert);
-int gnutls_x509_crt_import(gnutls_x509_crt_t cert,
- const gnutls_datum_t * data,
- gnutls_x509_crt_fmt_t format);
-int gnutls_x509_crt_export(gnutls_x509_crt_t cert,
- gnutls_x509_crt_fmt_t format,
- void *output_data,
- size_t * output_data_size);
+int gnutls_x509_crt_get_serial (gnutls_x509_crt_t cert,
+ void *result, size_t * result_size);
-int gnutls_x509_crt_get_key_usage(gnutls_x509_crt_t cert,
- unsigned int *key_usage,
- unsigned int *critical);
-int gnutls_x509_crt_get_signature_algorithm(gnutls_x509_crt_t cert);
-int gnutls_x509_crt_get_version(gnutls_x509_crt_t cert);
+int _gnutls_x509_compare_raw_dn (const gnutls_datum_t * dn1,
+ const gnutls_datum_t * dn2);
-int gnutls_x509_privkey_init(gnutls_x509_privkey_t * key);
-void gnutls_x509_privkey_deinit(gnutls_x509_privkey_t key);
+int gnutls_x509_crt_check_revocation (gnutls_x509_crt_t cert,
+ const gnutls_x509_crl_t * crl_list,
+ int crl_list_length);
-int gnutls_x509_privkey_generate(gnutls_x509_privkey_t key,
- enum MHD_GNUTLS_PublicKeyAlgorithm algo,
- unsigned int bits,
- unsigned int flags);
+int _gnutls_x509_crl_cpy (gnutls_x509_crl_t dest, gnutls_x509_crl_t src);
+int _gnutls_x509_crl_get_raw_issuer_dn (gnutls_x509_crl_t crl,
+ gnutls_datum_t * dn);
+int gnutls_x509_crl_get_crt_count (gnutls_x509_crl_t crl);
+int gnutls_x509_crl_get_crt_serial (gnutls_x509_crl_t crl,
+ int indx,
+ unsigned char *serial,
+ size_t * serial_size, time_t * t);
-int gnutls_x509_privkey_import(gnutls_x509_privkey_t key,
- const gnutls_datum_t * data,
- gnutls_x509_crt_fmt_t format);
-int gnutls_x509_privkey_get_pk_algorithm(gnutls_x509_privkey_t key);
-int gnutls_x509_privkey_import_rsa_raw(gnutls_x509_privkey_t key,
- const gnutls_datum_t * m,
- const gnutls_datum_t * e,
- const gnutls_datum_t * d,
- const gnutls_datum_t * p,
- const gnutls_datum_t * q,
- const gnutls_datum_t * u);
-int gnutls_x509_privkey_export_rsa_raw(gnutls_x509_privkey_t key,
- gnutls_datum_t * m,
- gnutls_datum_t * e,
- gnutls_datum_t * d,
- gnutls_datum_t * p,
- gnutls_datum_t * q,
- gnutls_datum_t * u);
-int gnutls_x509_privkey_export(gnutls_x509_privkey_t key,
- gnutls_x509_crt_fmt_t format,
- void *output_data,
- size_t * output_data_size);
+void gnutls_x509_crl_deinit (gnutls_x509_crl_t crl);
+int gnutls_x509_crl_init (gnutls_x509_crl_t * crl);
+int gnutls_x509_crl_import (gnutls_x509_crl_t crl,
+ const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+int gnutls_x509_crl_export (gnutls_x509_crl_t crl,
+ gnutls_x509_crt_fmt_t format,
+ void *output_data, size_t * output_data_size);
+
+int gnutls_x509_crt_init (gnutls_x509_crt_t * cert);
+void gnutls_x509_crt_deinit (gnutls_x509_crt_t cert);
+int gnutls_x509_crt_import (gnutls_x509_crt_t cert,
+ const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+int gnutls_x509_crt_export (gnutls_x509_crt_t cert,
+ gnutls_x509_crt_fmt_t format,
+ void *output_data, size_t * output_data_size);
+
+int gnutls_x509_crt_get_key_usage (gnutls_x509_crt_t cert,
+ unsigned int *key_usage,
+ unsigned int *critical);
+int gnutls_x509_crt_get_signature_algorithm (gnutls_x509_crt_t cert);
+int gnutls_x509_crt_get_version (gnutls_x509_crt_t cert);
+
+int gnutls_x509_privkey_init (gnutls_x509_privkey_t * key);
+void gnutls_x509_privkey_deinit (gnutls_x509_privkey_t key);
+
+int gnutls_x509_privkey_generate (gnutls_x509_privkey_t key,
+ enum MHD_GNUTLS_PublicKeyAlgorithm algo,
+ unsigned int bits, unsigned int flags);
+
+int gnutls_x509_privkey_import (gnutls_x509_privkey_t key,
+ const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+int gnutls_x509_privkey_get_pk_algorithm (gnutls_x509_privkey_t key);
+int gnutls_x509_privkey_import_rsa_raw (gnutls_x509_privkey_t key,
+ const gnutls_datum_t * m,
+ const gnutls_datum_t * e,
+ const gnutls_datum_t * d,
+ const gnutls_datum_t * p,
+ const gnutls_datum_t * q,
+ const gnutls_datum_t * u);
+int gnutls_x509_privkey_export_rsa_raw (gnutls_x509_privkey_t key,
+ gnutls_datum_t * m,
+ gnutls_datum_t * e,
+ gnutls_datum_t * d,
+ gnutls_datum_t * p,
+ gnutls_datum_t * q,
+ gnutls_datum_t * u);
+int gnutls_x509_privkey_export (gnutls_x509_privkey_t key,
+ gnutls_x509_crt_fmt_t format,
+ void *output_data, size_t * output_data_size);
#define GNUTLS_CRL_REASON_UNUSED 128
#define GNUTLS_CRL_REASON_KEY_COMPROMISE 64
diff --git a/src/daemon/https/x509/x509_privkey.c b/src/daemon/https/x509/x509_privkey.c
index 5e58cffb..e890843d 100644
--- a/src/daemon/https/x509/x509_privkey.c
+++ b/src/daemon/https/x509/x509_privkey.c
@@ -446,7 +446,7 @@ gnutls_x509_privkey_import (gnutls_x509_privkey_t key,
*
* This function will convert the given RSA raw parameters
* to the native gnutls_x509_privkey_t format. The output will be stored in @key.
- *
+ *
**/
int
gnutls_x509_privkey_import_rsa_raw (gnutls_x509_privkey_t key,
@@ -646,7 +646,7 @@ gnutls_x509_privkey_export (gnutls_x509_privkey_t key,
* This function will export the RSA private key's parameters found in the given
* structure. The new parameters will be allocated using
* gnutls_malloc() and will be stored in the appropriate datum.
- *
+ *
**/
int
gnutls_x509_privkey_export_rsa_raw (gnutls_x509_privkey_t key,
@@ -760,7 +760,7 @@ error:_gnutls_free_datum (m);
* This function will export the DSA private key's parameters found in the given
* structure. The new parameters will be allocated using
* gnutls_malloc() and will be stored in the appropriate datum.
- *
+ *
**/
int
gnutls_x509_privkey_export_dsa_raw (gnutls_x509_privkey_t key,
@@ -960,7 +960,7 @@ _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params)
goto cleanup;
}
- /* Write PRIME
+ /* Write PRIME
*/
if ((result = asn1_write_value (*c2, "modulus", m_data, size[0]))
!= ASN1_SUCCESS)
@@ -1120,7 +1120,7 @@ _gnutls_asn1_encode_dsa (ASN1_TYPE * c2, mpi_t * params)
goto cleanup;
}
- /* Write PRIME
+ /* Write PRIME
*/
if ((result = asn1_write_value (*c2, "p", p_data, size[0])) != ASN1_SUCCESS)
{
@@ -1183,7 +1183,7 @@ cleanup:asn1_delete_structure (c2);
* @flags: unused for now. Must be 0.
*
* This function will generate a random private key. Note that
- * this function must be called on an empty private key.
+ * this function must be called on an empty private key.
*
* Returns 0 on success or a negative value on error.
*
@@ -1409,7 +1409,7 @@ gnutls_x509_privkey_sign_hash (gnutls_x509_privkey_t key,
}
result = mhd_gtls_sign (key->pk_algorithm, key->params,
- key->params_size, hash, signature);
+ key->params_size, hash, signature);
if (result < 0)
{
gnutls_assert ();
diff --git a/src/daemon/https/x509/x509_verify.c b/src/daemon/https/x509/x509_verify.c
index 646bdf10..e9d784ce 100644
--- a/src/daemon/https/x509/x509_verify.c
+++ b/src/daemon/https/x509/x509_verify.c
@@ -201,7 +201,7 @@ find_issuer (gnutls_x509_crt_t cert,
{
int i;
- /* this is serial search.
+ /* this is serial search.
*/
for (i = 0; i < tcas_size; i++)
@@ -214,11 +214,11 @@ find_issuer (gnutls_x509_crt_t cert,
return NULL;
}
-/*
+/*
* Verifies the given certificate again a certificate list of
* trusted CAs.
*
- * Returns only 0 or 1. If 1 it means that the certificate
+ * Returns only 0 or 1. If 1 it means that the certificate
* was successfuly verified.
*
* 'flags': an OR of the gnutls_certificate_verify_flags enumeration.
@@ -435,7 +435,7 @@ _gnutls_x509_verify_certificate (const gnutls_x509_crt_t * certificate_list,
clist_size--;
}
- /* Verify the certificate path (chain)
+ /* Verify the certificate path (chain)
*/
for (i = clist_size - 1; i > 0; i--)
{
@@ -465,7 +465,7 @@ _gnutls_x509_verify_certificate (const gnutls_x509_crt_t * certificate_list,
*/
static int
decode_ber_digest_info (const gnutls_datum_t * info,
- enum MHD_GNUTLS_HashAlgorithm * hash,
+ enum MHD_GNUTLS_HashAlgorithm *hash,
opaque * digest, int *digest_size)
{
ASN1_TYPE dinfo = ASN1_TYPE_EMPTY;
@@ -664,7 +664,7 @@ verify_sig (const gnutls_datum_t * tbs,
/* verifies if the certificate is properly signed.
* returns 0 on failure and 1 on success.
- *
+ *
* 'tbs' is the signed data
* 'signature' is the signature!
*/
@@ -707,7 +707,7 @@ _gnutls_x509_verify_signature (const gnutls_datum_t * tbs,
/* verifies if the certificate is properly signed.
* returns 0 on failure and 1 on success.
- *
+ *
* 'tbs' is the signed data
* 'signature' is the signature!
*/
@@ -743,12 +743,12 @@ _gnutls_x509_privkey_verify_signature (const gnutls_datum_t * tbs,
* Note that expiration and activation dates are not checked
* by this function, you should check them using the appropriate functions.
*
- * If no flags are specified (0), this function will use the
- * basicConstraints (2.5.29.19) PKIX extension. This means that only a certificate
+ * If no flags are specified (0), this function will use the
+ * basicConstraints (2.5.29.19) PKIX extension. This means that only a certificate
* authority is allowed to sign a certificate.
*
- * You must also check the peer's name in order to check if the verified
- * certificate belongs to the actual peer.
+ * You must also check the peer's name in order to check if the verified
+ * certificate belongs to the actual peer.
*
* The certificate verification output will be put in @verify and will be
* one or more of the gnutls_certificate_status_t enumerated elements bitwise or'd.
@@ -774,7 +774,7 @@ gnutls_x509_crt_list_verify (const gnutls_x509_crt_t * cert_list,
if (cert_list == NULL || cert_list_length == 0)
return GNUTLS_E_NO_CERTIFICATE_FOUND;
- /* Verify certificate
+ /* Verify certificate
*/
*verify = _gnutls_x509_verify_certificate (cert_list, cert_list_length,
CA_list, CA_list_length,
@@ -792,7 +792,7 @@ gnutls_x509_crt_list_verify (const gnutls_x509_crt_t * cert_list,
* @flags: Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.
* @verify: will hold the certificate verification output.
*
- * This function will try to verify the given certificate and return its status.
+ * This function will try to verify the given certificate and return its status.
* The verification output in this functions cannot be GNUTLS_CERT_NOT_VALID.
*
* Returns 0 on success and a negative value in case of an error.
@@ -805,7 +805,7 @@ gnutls_x509_crt_verify (gnutls_x509_crt_t cert,
unsigned int flags, unsigned int *verify)
{
int ret;
- /* Verify certificate
+ /* Verify certificate
*/
ret = _gnutls_verify_certificate2 (cert, CA_list, CA_list_length, flags,
verify);
@@ -861,7 +861,7 @@ gnutls_x509_crl_verify (gnutls_x509_crl_t crl,
unsigned int *verify)
{
int ret;
- /* Verify crl
+ /* Verify crl
*/
ret = _gnutls_verify_crl2 (crl, CA_list, CA_list_length, flags, verify);
if (ret < 0)
@@ -912,7 +912,7 @@ find_crl_issuer (gnutls_x509_crl_t crl,
{
int i;
- /* this is serial search.
+ /* this is serial search.
*/
for (i = 0; i < tcas_size; i++)
@@ -925,14 +925,14 @@ find_crl_issuer (gnutls_x509_crl_t crl,
return NULL;
}
-/*
+/*
* Returns only 0 or 1. If 1 it means that the CRL
* was successfuly verified.
*
* 'flags': an OR of the gnutls_certificate_verify_flags enumeration.
*
* Output will hold information about the verification
- * procedure.
+ * procedure.
*/
static int
_gnutls_verify_crl2 (gnutls_x509_crl_t crl,
diff --git a/src/daemon/https/x509/x509_write.c b/src/daemon/https/x509/x509_write.c
index 944b863c..342e117d 100644
--- a/src/daemon/https/x509/x509_write.c
+++ b/src/daemon/https/x509/x509_write.c
@@ -118,7 +118,7 @@ gnutls_x509_crt_set_issuer_dn_by_oid (gnutls_x509_crt_t crt,
}
/**
- * gnutls_x509_crt_set_proxy_dn - Set Proxy Certificate subject's distinguished name
+ * gnutls_x509_crt_set_proxy_dn - Set Proxy Certificate subject's distinguished name
* @crt: a gnutls_x509_crt_t structure with the new proxy cert
* @eecrt: the end entity certificate that will be issuing the proxy
* @raw_flag: must be 0, or 1 if the CN is DER encoded
@@ -407,7 +407,7 @@ gnutls_x509_crt_set_ca_status (gnutls_x509_crt_t crt, unsigned int ca)
* @crt: should contain a gnutls_x509_crt_t structure
* @usage: an ORed sequence of the GNUTLS_KEY_* elements.
*
- * This function will set the keyUsage certificate extension.
+ * This function will set the keyUsage certificate extension.
*
* Returns 0 on success.
*
@@ -454,7 +454,7 @@ gnutls_x509_crt_set_key_usage (gnutls_x509_crt_t crt, unsigned int usage)
* @type: is one of the gnutls_x509_subject_alt_name_t enumerations
* @data_string: The data to be set
*
- * This function will set the subject alternative name certificate extension.
+ * This function will set the subject alternative name certificate extension.
*
* Returns 0 on success.
*
@@ -520,7 +520,7 @@ gnutls_x509_crt_set_subject_alternative_name (gnutls_x509_crt_t crt,
* and negative values indicate that the pathLenConstraints field should
* not be present.
* @policyLanguage: OID describing the language of @policy.
- * @policy: opaque byte array with policy language, can be %NULL
+ * @policy: opaque byte array with policy language, can be %NULL
* @sizeof_policy: size of @policy.
*
* This function will set the proxyCertInfo extension.
@@ -688,10 +688,10 @@ gnutls_x509_crt_set_expiration_time (gnutls_x509_crt_t cert, time_t exp_time)
* @serial: The serial number
* @serial_size: Holds the size of the serial field.
*
- * This function will set the X.509 certificate's serial number.
+ * This function will set the X.509 certificate's serial number.
* Serial is not always a 32 or 64bit number. Some CAs use
* large serial numbers, thus it may be wise to handle it as something
- * opaque.
+ * opaque.
*
* Returns 0 on success, or a negative value in case of an error.
*
@@ -748,7 +748,7 @@ disable_optional_stuff (gnutls_x509_crt_t cert)
* @data_string: The data to be set
* @reason_flags: revocation reasons
*
- * This function will set the CRL distribution points certificate extension.
+ * This function will set the CRL distribution points certificate extension.
*
* Returns 0 on success.
*
@@ -814,7 +814,7 @@ gnutls_x509_crt_set_crl_dist_points (gnutls_x509_crt_t crt,
* @dst: should contain a gnutls_x509_crt_t structure
* @src: the certificate where the dist points will be copied from
*
- * This function will copy the CRL distribution points certificate
+ * This function will copy the CRL distribution points certificate
* extension, from the source to the destination certificate.
* This may be useful to copy from a CA certificate to issued ones.
*
diff --git a/src/daemon/internal.h b/src/daemon/internal.h
index 0fca73d2..940d631f 100644
--- a/src/daemon/internal.h
+++ b/src/daemon/internal.h
@@ -279,7 +279,7 @@ enum MHD_CONNECTION_STATE
* Handshake messages will be processed in this state & while
* in the 'MHD_TLS_HELLO_REQUEST' state
*/
- MHD_TLS_CONNECTION_INIT = MHD_CONNECTION_CLOSED +1,
+ MHD_TLS_CONNECTION_INIT = MHD_CONNECTION_CLOSED + 1,
/*
* This state indicates the server has send a 'Hello Request' to
@@ -303,7 +303,7 @@ enum MHD_CONNECTION_STATE
#define DEBUG_STATES MHD_NO
#if DEBUG_STATES
-char * MHD_state_to_string(enum MHD_CONNECTION_STATE state);
+char *MHD_state_to_string (enum MHD_CONNECTION_STATE state);
#endif
struct MHD_Connection
@@ -543,9 +543,9 @@ struct MHD_Connection
* function pointers to the appropriate send & receive funtions
* according to whether this is a HTTPS / HTTP daemon
*/
- ssize_t (*recv_cls) (struct MHD_Connection * connection);
+ ssize_t (*recv_cls) (struct MHD_Connection * connection);
- ssize_t (*send_cls) (struct MHD_Connection * connection);
+ ssize_t (*send_cls) (struct MHD_Connection * connection);
#if HTTPS_SUPPORT
/* TODO rename as this might be an SSL connection */
@@ -641,13 +641,13 @@ struct MHD_Daemon
/* Diffie-Hellman parameters */
mhd_gtls_dh_params_t dh_params;
- const char * https_key_path;
+ const char *https_key_path;
- const char * https_cert_path;
+ const char *https_cert_path;
- const char * https_mem_key;
+ const char *https_mem_key;
- const char * https_mem_cert;
+ const char *https_mem_cert;
#endif
};
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 1238d789..c3f55942 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -280,7 +280,6 @@ enum MHD_FLAG
* MHD, and OFF in production.
*/
MHD_USE_PEDANTIC_CHECKS = 32
-
};
/**
@@ -373,7 +372,7 @@ enum MHD_OPTION
* This should be used in conjunction with 'MHD_OPTION_HTTPS_MEM_CERT'.
*/
MHD_OPTION_HTTPS_MEM_KEY = 9,
-
+
/**
* Memory pointer for the certificate (cert.pem) to be used by the
* HTTPS daemon. This option should be followed by an
@@ -392,16 +391,16 @@ enum MHD_OPTION
/**
* SSL/TLS protocol version.
*
- * Memory pointer to a zero (MHD_GNUTLS_PROTOCOL_END) terminated
+ * Memory pointer to a zero (MHD_GNUTLS_PROTOCOL_END) terminated
* (const) array of 'enum MHD_GNUTLS_Protocol' values representing the
* protocol versions to this server should support. Unsupported
- * requests will be droped by the server.
+ * requests will be droped by the server.
*/
MHD_OPTION_PROTOCOL_VERSION = 12,
/**
- * Memory pointer to a zero (MHD_GNUTLS_CIPHER_UNKNOWN)
- * terminated (const) array of 'enum MHD_GNUTLS_CipherAlgorithm'
+ * Memory pointer to a zero (MHD_GNUTLS_CIPHER_UNKNOWN)
+ * terminated (const) array of 'enum MHD_GNUTLS_CipherAlgorithm'
* representing the cipher priority order to which the HTTPS
* daemon should adhere.
*/
@@ -421,7 +420,7 @@ enum MHD_OPTION
MHD_OPTION_CERT_TYPE = 15,
/**
- * Specify the mac algorithm used by server.
+ * Specify the mac algorithm used by server.
* The argument should be of type "enum MHD_GNUTLS_MacAlgorithm"
*/
MHD_OPTION_MAC_ALGO = 16,
@@ -481,7 +480,6 @@ enum MHD_ValueKind
* HTTP footer (only for http 1.1 chunked encodings).
*/
MHD_FOOTER_KIND = 16
-
};
/**
@@ -519,13 +517,12 @@ enum MHD_RequestTerminationCode
/* FIXME: add TLS-specific error codes,
but only those that are useful! */
/**
- * Processing of this secure connection encountered
+ * Processing of this secure connection encountered
* an error.
*/
MHD_TLS_REQUEST_TERMINATED_WITH_ERROR,
-
- MHD_TLS_REQUEST_TERMINATED_WITH_FATAL_ALERT
+ MHD_TLS_REQUEST_TERMINATED_WITH_FATAL_ALERT
};
/**
@@ -546,7 +543,7 @@ enum MHD_GNUTLS_CipherAlgorithm
MHD_GNUTLS_CIPHER_CAMELLIA_256_CBC,
MHD_GNUTLS_CIPHER_RC2_40_CBC = 90,
MHD_GNUTLS_CIPHER_DES_CBC
-}; // enum MHD_GNUTLS_CipherAlgorithm;
+}; // enum MHD_GNUTLS_CipherAlgorithm;
/**
* Which public key algorithm should be used
@@ -568,7 +565,7 @@ enum MHD_GNUTLS_KeyExchangeAlgorithm
};
/**
- * Server credentials type
+ * Server credentials type
*/
enum MHD_GNUTLS_CredentialsType
{
@@ -590,8 +587,8 @@ enum MHD_GNUTLS_HashAlgorithm
MHD_GNUTLS_MAC_MD5,
MHD_GNUTLS_MAC_SHA1,
MHD_GNUTLS_MAC_SHA256
- //GNUTLS_MAC_SHA384,
- //GNUTLS_MAC_SHA512
+ //GNUTLS_MAC_SHA384,
+ //GNUTLS_MAC_SHA512
};
/**
@@ -630,7 +627,7 @@ enum MHD_GNUTLS_PublicKeyAlgorithm
{
MHD_GNUTLS_PK_UNKNOWN = 0,
MHD_GNUTLS_PK_RSA = 1
- //GNUTLS_PK_DSA
+ //GNUTLS_PK_DSA
};
/**
@@ -906,18 +903,18 @@ typedef int
* terminated with MHD_OPTION_END).
* @return NULL on error, handle to daemon on success
*/
-struct MHD_Daemon *
-MHD_start_daemon_va (unsigned int options,
- unsigned short port,
- MHD_AcceptPolicyCallback apc,
- void *apc_cls,
- MHD_AccessHandlerCallback dh, void *dh_cls, va_list ap);
+struct MHD_Daemon *MHD_start_daemon_va (unsigned int options,
+ unsigned short port,
+ MHD_AcceptPolicyCallback apc,
+ void *apc_cls,
+ MHD_AccessHandlerCallback dh,
+ void *dh_cls, va_list ap);
/*
* Variadic version of MHD_start_daemon_va. This function will delegate calls
* to MHD_start_daemon_va() once argument list is analyzed.
*/
-struct MHD_Daemon * MHD_start_daemon (unsigned int flags,
+struct MHD_Daemon *MHD_start_daemon (unsigned int flags,
unsigned short port,
MHD_AcceptPolicyCallback apc,
void *apc_cls,
@@ -1014,9 +1011,8 @@ MHD_get_connection_values (struct MHD_Connection *connection,
*/
int
MHD_set_connection_value (struct MHD_Connection *connection,
- enum MHD_ValueKind kind,
- const char *key,
- const char *value);
+ enum MHD_ValueKind kind,
+ const char *key, const char *value);
/**
* Get a particular header value. If multiple
@@ -1129,7 +1125,7 @@ MHD_get_response_headers (struct MHD_Response *response,
* @param key which header to get
* @return NULL if header does not exist
*/
-const char * MHD_get_response_header (struct MHD_Response *response,
+const char *MHD_get_response_header (struct MHD_Response *response,
const char *key);
@@ -1211,10 +1207,11 @@ union MHD_ConnectionInfo
* @return NULL if this information is not available
* (or if the infoType is unknown)
*/
-const union MHD_ConnectionInfo *
-MHD_get_connection_info (struct MHD_Connection * connection,
- enum MHD_ConnectionInfoType infoType,
- ...);
+const union MHD_ConnectionInfo *MHD_get_connection_info (struct MHD_Connection
+ *connection,
+ enum
+ MHD_ConnectionInfoType
+ infoType, ...);
/**
@@ -1242,10 +1239,9 @@ union MHD_DaemonInfo
* @return NULL if this information is not available
* (or if the infoType is unknown)
*/
-const union MHD_DaemonInfo *
-MHD_get_daemon_info (struct MHD_Daemon * daemon,
- enum MHD_DaemonInfoType infoType,
- ...);
+const union MHD_DaemonInfo *MHD_get_daemon_info (struct MHD_Daemon *daemon,
+ enum MHD_DaemonInfoType
+ infoType, ...);
#if 0 /* keep Emacsens' auto-indent happy */
{
diff --git a/src/include/platform.h b/src/include/platform.h
index 3e81a4f6..a4a16f21 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -26,7 +26,7 @@
* before "microhttpd.h"; it provides the required
* standard headers (which are platform-specific).
*
- * Note that this file depends on our configure.ac
+ * Note that this file depends on our configure.ac
* build process and the generated config.h file.
* Hence you cannot include it directly in applications
* that use libmicrohttpd.
diff --git a/src/testcurl/https/mhds_session_info_test.c b/src/testcurl/https/mhds_session_info_test.c
index 2c8f37c2..1fe8cde3 100644
--- a/src/testcurl/https/mhds_session_info_test.c
+++ b/src/testcurl/https/mhds_session_info_test.c
@@ -69,8 +69,8 @@ query_session_ahc (void *cls, struct MHD_Connection *connection,
int ret;
/* assert actual connection cipher is the one negotiated */
- if (MHD_get_session_info (connection, MHS_INFO_CIPHER_ALGO).
- cipher_algorithm != MHD_GNUTLS_CIPHER_AES_256_CBC)
+ if (MHD_get_session_info (connection, MHS_INFO_CIPHER_ALGO).cipher_algorithm
+ != MHD_GNUTLS_CIPHER_AES_256_CBC)
{
fprintf (stderr, "Error: requested cipher mismatch. %s\n",
strerror (errno));
@@ -85,16 +85,18 @@ query_session_ahc (void *cls, struct MHD_Connection *connection,
return -1;
}
- if (MHD_get_session_info (connection, MHD_INFO_MAC_ALGO).
- mac_algorithm != MHD_GNUTLS_MAC_SHA1)
+ if (MHD_get_session_info (connection, MHD_INFO_MAC_ALGO).mac_algorithm !=
+ MHD_GNUTLS_MAC_SHA1)
{
fprintf (stderr, "Error: requested mac algorithm mismatch. %s\n",
strerror (errno));
return -1;
}
- if (MHD_get_session_info (connection, MHD_INFO_COMPRESSION_METHOD).
- compression_method != MHD_GNUTLS_COMP_NULL)
+ if (MHD_get_session_info
+ (connection,
+ MHD_INFO_COMPRESSION_METHOD).compression_method !=
+ MHD_GNUTLS_COMP_NULL)
{
fprintf (stderr, "Error: requested compression mismatch. %s\n",
strerror (errno));
@@ -109,16 +111,18 @@ query_session_ahc (void *cls, struct MHD_Connection *connection,
return -1;
}
- if (MHD_get_session_info (connection, MHD_INFO_CERT_TYPE).
- certificate_type != MHD_GNUTLS_CRT_X509)
+ if (MHD_get_session_info (connection, MHD_INFO_CERT_TYPE).certificate_type
+ != MHD_GNUTLS_CRT_X509)
{
fprintf (stderr, "Error: requested certificate mismatch. %s\n",
strerror (errno));
return -1;
}
- if (MHD_get_session_info (connection, MHD_INFO_CREDENTIALS_TYPE).
- credentials_type != MHD_GNUTLS_CRD_CERTIFICATE)
+ if (MHD_get_session_info
+ (connection,
+ MHD_INFO_CREDENTIALS_TYPE).credentials_type !=
+ MHD_GNUTLS_CRD_CERTIFICATE)
{
fprintf (stderr, "Error: requested certificate mismatch. %s\n",
strerror (errno));
diff --git a/src/testcurl/https/tls_alert_test.c b/src/testcurl/https/tls_alert_test.c
index 50fcc677..34ab883f 100644
--- a/src/testcurl/https/tls_alert_test.c
+++ b/src/testcurl/https/tls_alert_test.c
@@ -62,16 +62,16 @@ setup (mhd_gtls_session_t * session,
gnutls_datum_t * cert, mhd_gtls_cert_credentials_t * xcred)
{
int ret;
- const char ** err_pos;
+ const char **err_pos;
MHD_gnutls_certificate_allocate_credentials (xcred);
mhd_gtls_set_datum_m (key, srv_key_pem, strlen (srv_key_pem), &malloc);
mhd_gtls_set_datum_m (cert, srv_self_signed_cert_pem,
- strlen (srv_self_signed_cert_pem), &malloc);
+ strlen (srv_self_signed_cert_pem), &malloc);
MHD_gnutls_certificate_set_x509_key_mem (*xcred, cert, key,
- GNUTLS_X509_FMT_PEM);
+ GNUTLS_X509_FMT_PEM);
MHD_gnutls_init (session, GNUTLS_CLIENT);
ret = MHD_gnutls_priority_set_direct (*session, "NORMAL", err_pos);
@@ -166,7 +166,8 @@ test_alert_unexpected_message (mhd_gtls_session_t session)
sa.sin_port = htons (42433);
inet_pton (AF_INET, "127.0.0.1", &sa.sin_addr);
- MHD_gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) ((void *) sd));
+ MHD_gnutls_transport_set_ptr (session,
+ (gnutls_transport_ptr_t) ((void *) sd));
ret = connect (sd, &sa, sizeof (struct sockaddr_in));
@@ -182,7 +183,8 @@ test_alert_unexpected_message (mhd_gtls_session_t session)
return -1;
}
- MHD_gnutls_alert_send (session, GNUTLS_AL_FATAL, GNUTLS_A_UNEXPECTED_MESSAGE);
+ MHD_gnutls_alert_send (session, GNUTLS_AL_FATAL,
+ GNUTLS_A_UNEXPECTED_MESSAGE);
usleep (100);
/* TODO better RST trigger */
diff --git a/src/testcurl/https/tls_authentication_test.c b/src/testcurl/https/tls_authentication_test.c
index 77990c0e..82c3a0a3 100644
--- a/src/testcurl/https/tls_authentication_test.c
+++ b/src/testcurl/https/tls_authentication_test.c
@@ -227,7 +227,7 @@ test_secure_get (FILE * test_fd, char *cipher_suite, int proto_version)
int ret;
struct MHD_Daemon *d;
- d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_SSL |
+ d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_SSL |
MHD_USE_DEBUG, 42433,
NULL, NULL, &http_ahc, NULL,
MHD_OPTION_HTTPS_MEM_KEY, srv_signed_key_pem,
diff --git a/src/testcurl/https/tls_cipher_change_test.c b/src/testcurl/https/tls_cipher_change_test.c
index 2446d716..cbd832e4 100644
--- a/src/testcurl/https/tls_cipher_change_test.c
+++ b/src/testcurl/https/tls_cipher_change_test.c
@@ -70,10 +70,10 @@ setup (mhd_gtls_session_t * session,
mhd_gtls_set_datum_m (key, srv_key_pem, strlen (srv_key_pem), &malloc);
mhd_gtls_set_datum_m (cert, srv_self_signed_cert_pem,
- strlen (srv_self_signed_cert_pem), &malloc);
+ strlen (srv_self_signed_cert_pem), &malloc);
MHD_gnutls_certificate_set_x509_key_mem (*xcred, cert, key,
- GNUTLS_X509_FMT_PEM);
+ GNUTLS_X509_FMT_PEM);
MHD_gnutls_init (session, GNUTLS_CLIENT);
ret = MHD_gnutls_priority_set_direct (*session, "NORMAL", err_pos);
diff --git a/src/testcurl/https/tls_daemon_options_test.c b/src/testcurl/https/tls_daemon_options_test.c
index 1418dac0..556d6684 100644
--- a/src/testcurl/https/tls_daemon_options_test.c
+++ b/src/testcurl/https/tls_daemon_options_test.c
@@ -463,11 +463,10 @@ main (int argc, char *const *argv)
MHD_OPTION_CIPHER_ALGORITHM, cipher, MHD_OPTION_KX_PRIORITY,
kx, MHD_OPTION_END);
errorCount +=
- test_wrap ("ADH-AES256-SHA", &test_https_transfer, test_fd,
- "ADH-AES256-SHA", CURL_SSLVERSION_TLSv1,
- MHD_OPTION_CRED_TYPE, MHD_GNUTLS_CRD_ANON,
- MHD_OPTION_KX_PRIORITY,
- kx, MHD_OPTION_END);
+ test_wrap ("ADH-AES256-SHA", &test_https_transfer, test_fd,
+ "ADH-AES256-SHA", CURL_SSLVERSION_TLSv1,
+ MHD_OPTION_CRED_TYPE, MHD_GNUTLS_CRD_ANON,
+ MHD_OPTION_KX_PRIORITY, kx, MHD_OPTION_END);
if (errorCount != 0)
fprintf (stderr, "Failed test: %s.\n", argv[0]);
diff --git a/src/testcurl/https/tls_session_time_out_test.c b/src/testcurl/https/tls_session_time_out_test.c
index e9679b81..37d28656 100644
--- a/src/testcurl/https/tls_session_time_out_test.c
+++ b/src/testcurl/https/tls_session_time_out_test.c
@@ -66,10 +66,10 @@ setup (mhd_gtls_session_t * session,
mhd_gtls_set_datum_m (key, srv_key_pem, strlen (srv_key_pem), &malloc);
mhd_gtls_set_datum_m (cert, srv_self_signed_cert_pem,
- strlen (srv_self_signed_cert_pem), &malloc);
+ strlen (srv_self_signed_cert_pem), &malloc);
MHD_gnutls_certificate_set_x509_key_mem (*xcred, cert, key,
- GNUTLS_X509_FMT_PEM);
+ GNUTLS_X509_FMT_PEM);
MHD_gnutls_init (session, GNUTLS_CLIENT);
ret = MHD_gnutls_priority_set_direct (*session, "NORMAL", err_pos);
@@ -152,7 +152,7 @@ main (int argc, char *const *argv)
MHD_gnutls_global_init ();
MHD_gtls_global_set_log_level (11);
- d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_SSL |
+ d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_SSL |
MHD_USE_DEBUG, 42433,
NULL, NULL, &http_ahc, NULL,
MHD_OPTION_CONNECTION_TIMEOUT, TIME_OUT,
diff --git a/src/testcurl/https/tls_test_keys.h b/src/testcurl/https/tls_test_keys.h
index 871f99b1..7d7dac67 100644
--- a/src/testcurl/https/tls_test_keys.h
+++ b/src/testcurl/https/tls_test_keys.h
@@ -24,106 +24,104 @@
/* Certificate Authority key */
const char ca_key_pem[] =
- "-----BEGIN RSA PRIVATE KEY-----\n"
- "MIIEowIBAAKCAQEAthkEJMVt/l06gPJQCfdMKJdYXdQZGSBkOroWGZfs0oYBcSU3\n"
- "JeszCWwDgzw5Ac4o2no9/P7FLVm6+zaIO9gexVi2p1fDhT1+6Lir7O6waS94vLdu\n"
- "jxdJPGfakZTktRAA3MBbC1XuMYPYXZ6nUrRkmHLeG6Oj+L0U3iVq0ZjLYjekCmqV\n"
- "FXRaDmoLWkmxplK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w19Zbqlh4ZFuVw+QC1GTa0xlagHiRgXU2DOvPT5+y+XUR\n"
+ "TSy0Pqou7spgEkLcFxlXYlx3tpDu+Awmx9DBGHMCysVynnEzeBYW4woCfBG2UiVA\n"
+ "iHVz6jBc4bBkylKVkA42GiroExuPc+W9qtHGuVX045R7gz78KK0CMIObdySbogBe\n"
+ "gYZUbyVvPVHINEc929PoV12dHP7wrKnqPbiwb+h1SHui8bVinE+1JY3mRB1VGVTa\n"
+ "rgvlVGs2S+Zq48XMs4aeLgHkGWFAIXbpX34HSw==\n" "-----END CERTIFICATE-----\n";
/* test server CA signed certificates */
const char srv_signed_cert_pem[] =
- "-----BEGIN CERTIFICATE-----\n"
- "MIIDBDCCAe6gAwIBAgIESJ2sXzALBgkqhkiG9w0BAQUwFzEVMBMGA1UEAxMMdGVz\n"
- "dF9jYV9jZXJ0MB4XDTA4MDgwOTE0NDAzMloXDTA5MDgwOTE0NDAzNVowADCCAR8w\n"
- "CwYJKoZIhvcNAQEBA4IBDgAwggEJAoIBAOb6G6WJrrNC48NSh5i4eT7J1BCqlMB4\n"
- "e0No+td/PQf+sPywbQToYGiPfOFfMyge1G6SyRpXavKbPwuw1BN183WoYzID5mtz\n"
- "shAOl/JRhdusScFijS3pITiNK4G5NLToCP4KZhqguqHUzEdanifSb/D4x54Rq/Tc\n"
- "A7oHGp0wjdWC/AMtGWv6v55xMe00ALZ1zDxCOi8nri9W7mLy+hyduETCq+1Y7uHl\n"
- "mqbAk8D7ruu0JtNU2N8WuJJcAtxgZhCCfIHTgAUWqepeRBM8cy8uu0tywgxcJiyt\n"
- "Uu1wXQHnnpWrr/9r6IfhjFpc9pr5giHBeM4KdlU49UsYgaS1tAZsDJcCAwEAAaN2\n"
- "MHQwDAYDVR0TAQH/BAIwADATBgNVHSUEDDAKBggrBgEFBQcDATAPBgNVHQ8BAf8E\n"
- "BQMDB6AAMB0GA1UdDgQWBBSxP229okDqlKyMCyg0cnzbf+eb4DAfBgNVHSMEGDAW\n"
-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gNVHSUEDDAKBggrBgEFBQcDATAPBgNVHQ8BAf8E\n"
+ "BQMDB6AAMB0GA1UdDgQWBBSxP229okDqlKyMCyg0cnzbf+eb4DAfBgNVHSMEGDAW\n"
+ "gBRk1qI1FKym0v1InfUt4T8ZoCnmsTALBgkqhkiG9w0BAQUDggEBAEabY4FLsFQr\n"
+ "PACNe3p5tU3hWvvQ9S1pRlfnc/z1o+k9NDWTHlNjXfVTl6/6cIKHA+r8SvRks27+\n"
+ "lScfxFkiCi22YC7uPbn8fW1nWcsqEkK4e0TDekSUi1o6SDx6cU07kMpx3iKvpLs3\n"
+ "5QiCFjivMjrY8pEFJIke/ucI8QuLVZLLUSdTHb9Ck128PtPKA4y2uZA/MmYS/OtR\n"
+ "/UZN67pJ+BqcQBE5vNolWQTM+NxfMzb48IV9q32HRT4HErvUjLIWV0nwwedUSdDG\n"
+ "63tr9jp0GF6b5Eum0MTVV/zbBxfyRFg+Q8xRn70zJlB/W7byaFq/95Rpfqjdnta2\n"
+ "aO/omlvGHrI=\n" "-----END CERTIFICATE-----\n";
/* test server key */
const char srv_signed_key_pem[] =
- "-----BEGIN RSA PRIVATE KEY-----\n"
- "MIIEowIBAAKCAQEA5vobpYmus0Ljw1KHmLh5PsnUEKqUwHh7Q2j61389B/6w/LBt\n"
- "BOhgaI984V8zKB7UbpLJGldq8ps/C7DUE3XzdahjMgPma3OyEA6X8lGF26xJwWKN\n"
- "LekhOI0rgbk0tOgI/gpmGqC6odTMR1qeJ9Jv8PjHnhGr9NwDugcanTCN1YL8Ay0Z\n"
- "a/q/nnEx7TQAtnXMPEI6LyeuL1buYvL6HJ24RMKr7Vju4eWapsCTwPuu67Qm01TY\n"
- "3xa4klwC3GBmEIJ8gdOABRap6l5EEzxzLy67S3LCDFwmLK1S7XBdAeeelauv/2vo\n"
- "h+GMWlz2mvmCIcF4zgp2VTj1SxiBpLW0BmwMlwIDAQABAoIBACJGvGKQ74V3qDAc\n"
- "p7WwroF0Vw2QGtoDJxumUQ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YEA53vX9Hd8V85hCfeaTDf3B5q6g9kIliR+Y2tX2aSqN06df9J/KOdL\n"
+ "G/lEQn4rsOOtOwyTU2luPmcr0XgbXA1T1kj56+UZrxtRducsdsVbVixzD2KswtJO\n"
+ "wUH6XAJNdpI++64TuZadnKAaKiqim7CPzQYrBXYKKRFGSDd50urkTRMCgYEA/3CG\n"
+ "NMaG3qtzQceQUw7BBAhey387MR+1FUQHQ7xoq2jc3yAx4H2NEyGa6wL5CtFKn5In\n"
+ "BP6f30sk2ilXRv5pbIIiS8Xzngxy3m17GH33YrSc3ff/u+LWgR/EOVpa9F+sMAjp\n"
+ "ohDgI8iH8GtahrRA0BxQKfNIo2zUTqNwFP88xu0CgYADOY1zoWqBCqX9bo6euzTc\n"
+ "zUIF7jMZbF66Yddyd8HLTXQSQMt2tWotdJaH2pwfNbzHEtDGm7RmeCd7HpI7ARCG\n"
+ "7rNUnvdxog7LekL7UJqKI8pij3xapnVkadfkCkAsA7OO7AjoT/nYIb7bkYZ8ZsRK\n"
+ "FejphZB0rAHvpZ4z2wPdMwKBgQCfkr70RzVH81lcNXwutt/TUhtOCxyCMqmgMFBN\n"
+ "e2zz791TMjyWXjh8RBkQSVok7NwuVVI055AeIUZTV1IjkplvZNhh97aZ/HLiCwjE\n"
+ "IyUhL21zqRLEYA/auGqP3adGVGIv29GAIgSztfleMuJplj+LArT9j/LHzRvQSH+j\n"
+ "TlO8fQKBgE5og4pTfPrD0A7W/Li1HDGf8Ylb+DZlxoyMriW82Z/zCBvYvn1UvQRi\n"
+ "b8f3IQFXuXdf3Bx4C91kQJPovxDp14FOHJxO7F32fGMnJaU2kyp4sf4WAJZZOLnd\n"
+ "l64hMUsgYPI8qfsanAudD4gTAsLEP+ueWqkcb3SJNLSoQAtcGzYs\n"
+ "-----END RSA PRIVATE KEY-----\n";
/* test server self signed certificates */
const char srv_self_signed_cert_pem[] =