mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-10-07 04:02:18 +03:00
renaming enums to have MHD_ prefix always, removing a few redundant values
This commit is contained in:
1 parent
bb5fc0ba65
commit
46622f6b02
52 files changed
+754
-665
No files matched your search
@@ -1215,7 +1215,7 @@ cleanup:if (val.data != data->data)
|
||||
int
|
||||
_gnutls_x509_encode_and_copy_PKI_params (ASN1_TYPE dst,
|
||||
const char *dst_name,
|
||||
gnutls_pk_algorithm_t
|
||||
enum MHD_GNUTLS_PublicKeyAlgorithm
|
||||
pk_algorithm,
|
||||
mpi_t * params, int params_size)
|
||||
{
|
||||
|
||||
@@ -112,7 +112,7 @@ int _gnutls_x509_get_pk_algorithm (ASN1_TYPE src, const char *src_name,
|
||||
|
||||
int _gnutls_x509_encode_and_copy_PKI_params (ASN1_TYPE dst,
|
||||
const char *dst_name,
|
||||
gnutls_pk_algorithm_t
|
||||
enum MHD_GNUTLS_PublicKeyAlgorithm
|
||||
pk_algorithm, mpi_t * params,
|
||||
int params_size);
|
||||
int _gnutls_asn1_copy_node (ASN1_TYPE * dst, const char *dst_name,
|
||||
|
||||
@@ -102,7 +102,7 @@ gnutls_x509_crl_set_version (gnutls_x509_crl_t crl, unsigned int version)
|
||||
int
|
||||
gnutls_x509_crl_sign2 (gnutls_x509_crl_t crl, gnutls_x509_crt_t issuer,
|
||||
gnutls_x509_privkey_t issuer_key,
|
||||
gnutls_digest_algorithm_t dig, unsigned int flags)
|
||||
enum MHD_GNUTLS_HashAlgorithm dig, unsigned int flags)
|
||||
{
|
||||
int result;
|
||||
|
||||
@@ -143,7 +143,7 @@ int
|
||||
gnutls_x509_crl_sign (gnutls_x509_crl_t crl, gnutls_x509_crt_t issuer,
|
||||
gnutls_x509_privkey_t issuer_key)
|
||||
{
|
||||
return gnutls_x509_crl_sign2 (crl, issuer, issuer_key, MHD_GNUTLS_DIG_SHA1,
|
||||
return gnutls_x509_crl_sign2 (crl, issuer, issuer_key, MHD_GNUTLS_MAC_SHA1,
|
||||
0);
|
||||
}
|
||||
|
||||
|
||||
@@ -740,7 +740,7 @@ gnutls_x509_crq_set_challenge_password (gnutls_x509_crq_t crq,
|
||||
**/
|
||||
int
|
||||
gnutls_x509_crq_sign2 (gnutls_x509_crq_t crq, gnutls_x509_privkey_t key,
|
||||
gnutls_digest_algorithm_t dig, unsigned int flags)
|
||||
enum MHD_GNUTLS_HashAlgorithm dig, unsigned int flags)
|
||||
{
|
||||
int result;
|
||||
gnutls_datum_t signature;
|
||||
@@ -805,7 +805,7 @@ gnutls_x509_crq_sign2 (gnutls_x509_crq_t crq, gnutls_x509_privkey_t key,
|
||||
int
|
||||
gnutls_x509_crq_sign (gnutls_x509_crq_t crq, gnutls_x509_privkey_t key)
|
||||
{
|
||||
return gnutls_x509_crq_sign2 (crq, key, MHD_GNUTLS_DIG_SHA1, 0);
|
||||
return gnutls_x509_crq_sign2 (crq, key, MHD_GNUTLS_MAC_SHA1, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -857,7 +857,7 @@ gnutls_x509_crq_export (gnutls_x509_crq_t crq,
|
||||
* For DSA the bits returned are of the public
|
||||
* exponent.
|
||||
*
|
||||
* Returns a member of the gnutls_pk_algorithm_t enumeration on success,
|
||||
* Returns a member of the enum MHD_GNUTLS_PublicKeyAlgorithm enumeration on success,
|
||||
* or a negative value on error.
|
||||
*
|
||||
**/
|
||||
|
||||
@@ -335,8 +335,8 @@ cleanup:asn1_delete_structure (&spk);
|
||||
int
|
||||
_gnutls_x509_write_sig_params (ASN1_TYPE dst,
|
||||
const char *dst_name,
|
||||
gnutls_pk_algorithm_t pk_algorithm,
|
||||
gnutls_digest_algorithm_t dig,
|
||||
enum MHD_GNUTLS_PublicKeyAlgorithm pk_algorithm,
|
||||
enum MHD_GNUTLS_HashAlgorithm dig,
|
||||
mpi_t * params, int params_size)
|
||||
{
|
||||
int result;
|
||||
|
||||
@@ -52,6 +52,6 @@ int _gnutls_x509_write_uint32 (ASN1_TYPE node, const char *value,
|
||||
uint32_t num);
|
||||
|
||||
int _gnutls_x509_write_sig_params (ASN1_TYPE dst, const char *dst_name,
|
||||
gnutls_pk_algorithm_t pk_algorithm,
|
||||
gnutls_digest_algorithm_t, mpi_t * params,
|
||||
enum MHD_GNUTLS_PublicKeyAlgorithm pk_algorithm,
|
||||
enum MHD_GNUTLS_HashAlgorithm, mpi_t * params,
|
||||
int params_size);
|
||||
@@ -63,7 +63,7 @@ struct pbkdf2_params
|
||||
|
||||
struct pbe_enc_params
|
||||
{
|
||||
gnutls_cipher_algorithm_t cipher;
|
||||
enum MHD_GNUTLS_CipherAlgorithm cipher;
|
||||
opaque iv[8];
|
||||
int iv_size;
|
||||
};
|
||||
@@ -1284,7 +1284,7 @@ error:
|
||||
/* Converts an OID to a gnutls cipher type.
|
||||
*/
|
||||
inline static int
|
||||
oid2cipher (const char *oid, gnutls_cipher_algorithm_t * algo)
|
||||
oid2cipher (const char *oid, enum MHD_GNUTLS_CipherAlgorithm * algo)
|
||||
{
|
||||
|
||||
*algo = 0;
|
||||
|
||||
@@ -49,14 +49,14 @@
|
||||
* structure. The digest info is allocated and stored into the info structure.
|
||||
*/
|
||||
static int
|
||||
encode_ber_digest_info (gnutls_digest_algorithm_t hash,
|
||||
encode_ber_digest_info (enum MHD_GNUTLS_HashAlgorithm hash,
|
||||
const gnutls_datum_t * digest, gnutls_datum_t * info)
|
||||
{
|
||||
ASN1_TYPE dinfo = ASN1_TYPE_EMPTY;
|
||||
int result;
|
||||
const char *algo;
|
||||
|
||||
algo = mhd_gtls_x509_mac_to_oid ((gnutls_mac_algorithm_t) hash);
|
||||
algo = mhd_gtls_x509_mac_to_oid ((enum MHD_GNUTLS_HashAlgorithm) hash);
|
||||
if (algo == NULL)
|
||||
{
|
||||
gnutls_assert ();
|
||||
@@ -132,7 +132,7 @@ encode_ber_digest_info (gnutls_digest_algorithm_t hash,
|
||||
* params[1] is public key
|
||||
*/
|
||||
static int
|
||||
pkcs1_rsa_sign (gnutls_digest_algorithm_t hash, const gnutls_datum_t * text,
|
||||
pkcs1_rsa_sign (enum MHD_GNUTLS_HashAlgorithm hash, const gnutls_datum_t * text,
|
||||
mpi_t * params, int params_len, gnutls_datum_t * signature)
|
||||
{
|
||||
int ret;
|
||||
@@ -186,7 +186,7 @@ pkcs1_rsa_sign (gnutls_digest_algorithm_t hash, const gnutls_datum_t * text,
|
||||
*/
|
||||
int
|
||||
_gnutls_x509_sign (const gnutls_datum_t * tbs,
|
||||
gnutls_digest_algorithm_t hash,
|
||||
enum MHD_GNUTLS_HashAlgorithm hash,
|
||||
gnutls_x509_privkey_t signer, gnutls_datum_t * signature)
|
||||
{
|
||||
int ret;
|
||||
@@ -217,7 +217,7 @@ _gnutls_x509_sign (const gnutls_datum_t * tbs,
|
||||
*/
|
||||
int
|
||||
_gnutls_x509_sign_tbs (ASN1_TYPE cert, const char *tbs_name,
|
||||
gnutls_digest_algorithm_t hash,
|
||||
enum MHD_GNUTLS_HashAlgorithm hash,
|
||||
gnutls_x509_privkey_t signer,
|
||||
gnutls_datum_t * signature)
|
||||
{
|
||||
@@ -268,7 +268,7 @@ _gnutls_x509_sign_tbs (ASN1_TYPE cert, const char *tbs_name,
|
||||
-*/
|
||||
int
|
||||
_gnutls_x509_pkix_sign (ASN1_TYPE src, const char *src_name,
|
||||
gnutls_digest_algorithm_t dig,
|
||||
enum MHD_GNUTLS_HashAlgorithm dig,
|
||||
gnutls_x509_crt_t issuer,
|
||||
gnutls_x509_privkey_t issuer_key)
|
||||
{
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
*/
|
||||
|
||||
int _gnutls_x509_sign (const gnutls_datum_t * tbs,
|
||||
gnutls_digest_algorithm_t hash,
|
||||
enum MHD_GNUTLS_HashAlgorithm hash,
|
||||
gnutls_x509_privkey_t signer,
|
||||
gnutls_datum_t * signature);
|
||||
int _gnutls_x509_sign_tbs (ASN1_TYPE cert, const char *tbs_name,
|
||||
gnutls_digest_algorithm_t hash,
|
||||
enum MHD_GNUTLS_HashAlgorithm hash,
|
||||
gnutls_x509_privkey_t signer,
|
||||
gnutls_datum_t * signature);
|
||||
int _gnutls_x509_pkix_sign (ASN1_TYPE src, const char *src_name,
|
||||
gnutls_digest_algorithm_t,
|
||||
enum MHD_GNUTLS_HashAlgorithm,
|
||||
gnutls_x509_crt_t issuer,
|
||||
gnutls_x509_privkey_t issuer_key);
|
||||
@@ -858,7 +858,7 @@ gnutls_x509_crt_get_authority_key_id (gnutls_x509_crt_t cert,
|
||||
* For DSA the bits returned are of the public
|
||||
* exponent.
|
||||
*
|
||||
* Returns a member of the gnutls_pk_algorithm_t enumeration on success,
|
||||
* Returns a member of the enum MHD_GNUTLS_PublicKeyAlgorithm enumeration on success,
|
||||
* or a negative value on error.
|
||||
*
|
||||
**/
|
||||
@@ -1945,7 +1945,7 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
|
||||
**/
|
||||
int
|
||||
gnutls_x509_crt_get_fingerprint (gnutls_x509_crt_t cert,
|
||||
gnutls_digest_algorithm_t algo,
|
||||
enum MHD_GNUTLS_HashAlgorithm algo,
|
||||
void *buf, size_t * sizeof_buf)
|
||||
{
|
||||
opaque *cert_buf;
|
||||
@@ -2165,7 +2165,7 @@ gnutls_x509_crt_get_key_id (gnutls_x509_crt_t crt,
|
||||
return mhd_gtls_asn2err (result);
|
||||
}
|
||||
|
||||
result = MHD_gnutls_fingerprint (MHD_GNUTLS_DIG_SHA1, &pubkey, output_data,
|
||||
result = MHD_gnutls_fingerprint (MHD_GNUTLS_MAC_SHA1, &pubkey, output_data,
|
||||
output_data_size);
|
||||
|
||||
gnutls_afree (pubkey.data);
|
||||
|
||||
@@ -296,7 +296,7 @@ int gnutls_x509_crt_sign(gnutls_x509_crt_t crt,
|
||||
int gnutls_x509_crt_sign2(gnutls_x509_crt_t crt,
|
||||
gnutls_x509_crt_t issuer,
|
||||
gnutls_x509_privkey_t issuer_key,
|
||||
gnutls_digest_algorithm_t,
|
||||
enum MHD_GNUTLS_HashAlgorithm,
|
||||
unsigned int flags);
|
||||
int gnutls_x509_crt_set_activation_time(gnutls_x509_crt_t cert,
|
||||
time_t act_time);
|
||||
@@ -435,7 +435,7 @@ int gnutls_x509_crl_sign(gnutls_x509_crl_t crl,
|
||||
int gnutls_x509_crl_sign2(gnutls_x509_crl_t crl,
|
||||
gnutls_x509_crt_t issuer,
|
||||
gnutls_x509_privkey_t issuer_key,
|
||||
gnutls_digest_algorithm_t,
|
||||
enum MHD_GNUTLS_HashAlgorithm,
|
||||
unsigned int flags);
|
||||
int gnutls_x509_crl_set_this_update(gnutls_x509_crl_t crl,
|
||||
time_t act_time);
|
||||
@@ -556,7 +556,7 @@ int gnutls_x509_crt_check_revocation(gnutls_x509_crt_t cert,
|
||||
int crl_list_length);
|
||||
|
||||
int gnutls_x509_crt_get_fingerprint(gnutls_x509_crt_t cert,
|
||||
gnutls_digest_algorithm_t algo,
|
||||
enum MHD_GNUTLS_HashAlgorithm algo,
|
||||
void *buf,
|
||||
size_t * sizeof_buf);
|
||||
|
||||
@@ -631,7 +631,7 @@ int gnutls_x509_privkey_get_key_id(gnutls_x509_privkey_t key,
|
||||
size_t * output_data_size);
|
||||
|
||||
int gnutls_x509_privkey_generate(gnutls_x509_privkey_t key,
|
||||
gnutls_pk_algorithm_t algo,
|
||||
enum MHD_GNUTLS_PublicKeyAlgorithm algo,
|
||||
unsigned int bits,
|
||||
unsigned int flags);
|
||||
|
||||
@@ -656,7 +656,7 @@ int gnutls_x509_privkey_export_rsa_raw(gnutls_x509_privkey_t key,
|
||||
/* Signing stuff.
|
||||
*/
|
||||
int gnutls_x509_privkey_sign_data(gnutls_x509_privkey_t key,
|
||||
gnutls_digest_algorithm_t digest,
|
||||
enum MHD_GNUTLS_HashAlgorithm digest,
|
||||
unsigned int flags,
|
||||
const gnutls_datum_t * data,
|
||||
void *signature,
|
||||
@@ -710,7 +710,7 @@ 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,
|
||||
gnutls_digest_algorithm_t,
|
||||
enum MHD_GNUTLS_HashAlgorithm,
|
||||
unsigned int flags);
|
||||
int gnutls_x509_crq_sign(gnutls_x509_crq_t crq,
|
||||
gnutls_x509_privkey_t key);
|
||||
@@ -800,7 +800,7 @@ typedef struct MHD_gtls_x509_privkey_int
|
||||
*/
|
||||
int params_size; /* holds the number of params */
|
||||
|
||||
gnutls_pk_algorithm_t 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
|
||||
@@ -887,7 +887,7 @@ 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,
|
||||
gnutls_pk_algorithm_t algo,
|
||||
enum MHD_GNUTLS_PublicKeyAlgorithm algo,
|
||||
unsigned int bits,
|
||||
unsigned int flags);
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@ gnutls_x509_privkey_import_rsa_raw (gnutls_x509_privkey_t key,
|
||||
* This function will return the public key algorithm of a private
|
||||
* key.
|
||||
*
|
||||
* Returns a member of the gnutls_pk_algorithm_t enumeration on success,
|
||||
* Returns a member of the enum MHD_GNUTLS_PublicKeyAlgorithm enumeration on success,
|
||||
* or a negative value on error.
|
||||
*
|
||||
**/
|
||||
@@ -1190,7 +1190,7 @@ cleanup:asn1_delete_structure (c2);
|
||||
**/
|
||||
int
|
||||
gnutls_x509_privkey_generate (gnutls_x509_privkey_t key,
|
||||
gnutls_pk_algorithm_t algo,
|
||||
enum MHD_GNUTLS_PublicKeyAlgorithm algo,
|
||||
unsigned int bits, unsigned int flags)
|
||||
{
|
||||
int ret, params_len;
|
||||
@@ -1348,7 +1348,7 @@ cleanup:
|
||||
**/
|
||||
int
|
||||
gnutls_x509_privkey_sign_data (gnutls_x509_privkey_t key,
|
||||
gnutls_digest_algorithm_t digest,
|
||||
enum MHD_GNUTLS_HashAlgorithm digest,
|
||||
unsigned int flags,
|
||||
const gnutls_datum_t * data,
|
||||
void *signature, size_t * signature_size)
|
||||
|
||||
@@ -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,
|
||||
gnutls_mac_algorithm_t * hash,
|
||||
enum MHD_GNUTLS_HashAlgorithm * hash,
|
||||
opaque * digest, int *digest_size)
|
||||
{
|
||||
ASN1_TYPE dinfo = ASN1_TYPE_EMPTY;
|
||||
@@ -547,7 +547,7 @@ _pkcs1_rsa_verify_sig (const gnutls_datum_t * text,
|
||||
const gnutls_datum_t * signature,
|
||||
mpi_t * params, int params_len)
|
||||
{
|
||||
gnutls_mac_algorithm_t hash = MHD_GNUTLS_MAC_UNKNOWN;
|
||||
enum MHD_GNUTLS_HashAlgorithm hash = MHD_GNUTLS_MAC_UNKNOWN;
|
||||
int ret;
|
||||
opaque digest[MAX_HASH_SIZE], md[MAX_HASH_SIZE];
|
||||
int digest_size;
|
||||
@@ -637,7 +637,7 @@ dsa_verify_sig (const gnutls_datum_t * text,
|
||||
static int
|
||||
verify_sig (const gnutls_datum_t * tbs,
|
||||
const gnutls_datum_t * signature,
|
||||
gnutls_pk_algorithm_t pk,
|
||||
enum MHD_GNUTLS_PublicKeyAlgorithm pk,
|
||||
mpi_t * issuer_params, int issuer_params_size)
|
||||
{
|
||||
|
||||
|
||||
@@ -591,7 +591,7 @@ gnutls_x509_crt_set_proxy (gnutls_x509_crt_t crt,
|
||||
int
|
||||
gnutls_x509_crt_sign2 (gnutls_x509_crt_t crt, gnutls_x509_crt_t issuer,
|
||||
gnutls_x509_privkey_t issuer_key,
|
||||
gnutls_digest_algorithm_t dig, unsigned int flags)
|
||||
enum MHD_GNUTLS_HashAlgorithm dig, unsigned int flags)
|
||||
{
|
||||
int result;
|
||||
|
||||
@@ -632,7 +632,7 @@ int
|
||||
gnutls_x509_crt_sign (gnutls_x509_crt_t crt, gnutls_x509_crt_t issuer,
|
||||
gnutls_x509_privkey_t issuer_key)
|
||||
{
|
||||
return gnutls_x509_crt_sign2 (crt, issuer, issuer_key, MHD_GNUTLS_DIG_SHA1,
|
||||
return gnutls_x509_crt_sign2 (crt, issuer, issuer_key, MHD_GNUTLS_MAC_SHA1,
|
||||
0);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user