summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2005-03-19 14:44:30 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2005-03-19 14:44:30 +0000
commitcae06f1a943c9558ec3e3d1f4bf2bf2ce1ff7335 (patch)
tree5eea3b744f1e99ea6b788fbff88e5044fea699b2
parent95a7ce2cf821c2b8f31a57d6f5b094c1ff45426a (diff)
downloadgnutls-cae06f1a943c9558ec3e3d1f4bf2bf2ce1ff7335.tar.gz
*** empty log message ***
-rw-r--r--includes/gnutls/x509.h6
-rw-r--r--lib/gnutls_hash_int.h11
-rw-r--r--lib/x509/common.c8
-rw-r--r--lib/x509/crq.c44
-rw-r--r--lib/x509/privkey_pkcs8.c16
-rw-r--r--lib/x509/x509.h4
-rw-r--r--lib/x509/xml.c8
-rw-r--r--libextra/opencdk/opencdk.h2
8 files changed, 29 insertions, 70 deletions
diff --git a/includes/gnutls/x509.h b/includes/gnutls/x509.h
index 99475d3e00..513fc2ef2f 100644
--- a/includes/gnutls/x509.h
+++ b/includes/gnutls/x509.h
@@ -431,12 +431,18 @@ int gnutls_x509_crq_set_challenge_password(gnutls_x509_crq_t crq, const char* pa
int gnutls_x509_crq_get_challenge_password(gnutls_x509_crq_t crq,
const 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_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);
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/gnutls_hash_int.h b/lib/gnutls_hash_int.h
index 3a287f34cd..028e3e40ca 100644
--- a/lib/gnutls_hash_int.h
+++ b/lib/gnutls_hash_int.h
@@ -42,7 +42,7 @@ typedef mac_hd_t GNUTLS_HASH_HANDLE;
#define GNUTLS_MAC_FAILED NULL
mac_hd_t _gnutls_hmac_init(gnutls_mac_algorithm_t algorithm,
- const void *key, int keylen);
+ const void *key, int keylen);
#define _gnutls_hmac_get_algo_len _gnutls_hash_get_algo_len
#define _gnutls_hmac _gnutls_hash
void _gnutls_hmac_deinit(mac_hd_t handle, void *digest);
@@ -54,17 +54,16 @@ void _gnutls_mac_deinit_ssl3(mac_hd_t handle, void *digest);
GNUTLS_HASH_HANDLE _gnutls_hash_init(gnutls_mac_algorithm_t algorithm);
int _gnutls_hash_get_algo_len(gnutls_mac_algorithm_t algorithm);
int _gnutls_hash(GNUTLS_HASH_HANDLE handle, const void *text,
- size_t textlen);
+ size_t textlen);
void _gnutls_hash_deinit(GNUTLS_HASH_HANDLE handle, void *digest);
int _gnutls_ssl3_generate_random(void *secret, int secret_len,
- void *random, int random_len, int bytes,
- opaque * ret);
+ void *rnd, int random_len, int bytes, opaque * ret);
int _gnutls_ssl3_hash_md5(void *first, int first_len, void *second,
- int second_len, int ret_len, opaque * ret);
+ int second_len, int ret_len, opaque * ret);
void _gnutls_mac_deinit_ssl3_handshake(mac_hd_t handle, void *digest,
- opaque * key, uint32 key_size);
+ opaque * key, uint32 key_size);
GNUTLS_HASH_HANDLE _gnutls_hash_copy(GNUTLS_HASH_HANDLE handle);
diff --git a/lib/x509/common.c b/lib/x509/common.c
index db5e832cc2..37bd36f862 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -562,7 +562,7 @@ time_t _gnutls_x509_get_time(ASN1_TYPE c2, const char *when)
{
char ttime[MAX_TIME];
char name[1024];
- time_t ctime = (time_t) - 1;
+ time_t c_time = (time_t) - 1;
int len, result;
_gnutls_str_cpy(name, sizeof(name), when);
@@ -580,14 +580,14 @@ time_t _gnutls_x509_get_time(ASN1_TYPE c2, const char *when)
len = sizeof(ttime) - 1;
result = asn1_read_value(c2, name, ttime, &len);
if (result == ASN1_SUCCESS)
- ctime = _gnutls_x509_generalTime2gtime(ttime);
+ c_time = _gnutls_x509_generalTime2gtime(ttime);
} else { /* UTCTIME */
_gnutls_str_cat(name, sizeof(name), ".utcTime");
len = sizeof(ttime) - 1;
result = asn1_read_value(c2, name, ttime, &len);
if (result == ASN1_SUCCESS)
- ctime = _gnutls_x509_utcTime2gtime(ttime);
+ c_time = _gnutls_x509_utcTime2gtime(ttime);
}
/* We cannot handle dates after 2031 in 32 bit machines.
@@ -598,7 +598,7 @@ time_t _gnutls_x509_get_time(ASN1_TYPE c2, const char *when)
gnutls_assert();
return (time_t) (-1);
}
- return ctime;
+ return c_time;
}
/* Sets the time in time_t in the ASN1_TYPE given. Where should
diff --git a/lib/x509/crq.c b/lib/x509/crq.c
index 384d79a834..092d6863bf 100644
--- a/lib/x509/crq.c
+++ b/lib/x509/crq.c
@@ -668,50 +668,6 @@ int gnutls_x509_crq_set_challenge_password(gnutls_x509_crq_t crq,
}
/**
- * gnutls_x509_crq_set_attribute_by_oid - This function will set a challenge password
- * @crq: should contain a gnutls_x509_crq_t structure
- * @pass: holds a null terminated password
- *
- * This function will set a challenge password to be used when revoking the request.
- *
- * Returns 0 on success.
- *
- **/
-int gnutls_x509_crq_set_challenge_password(gnutls_x509_crq_t crq,
- const char *pass)
-{
- int result;
-
- if (crq == NULL) {
- gnutls_assert();
- return GNUTLS_E_INVALID_REQUEST;
- }
-
- /* Add the attribute.
- */
- result =
- asn1_write_value(crq->crq, "certificationRequestInfo.attributes",
- "NEW", 1);
- if (result != ASN1_SUCCESS) {
- gnutls_assert();
- return _gnutls_asn2err(result);
- }
-
- result =
- _gnutls_x509_encode_and_write_attribute("1.2.840.113549.1.9.7",
- crq->crq,
- "certificationRequestInfo.attributes.?LAST",
- pass, strlen(pass), 1);
-
- if (result < 0) {
- gnutls_assert();
- return result;
- }
-
- return 0;
-}
-
-/**
* gnutls_x509_crq_sign2 - This function will sign a Certificate request with a key
* @crq: should contain a gnutls_x509_crq_t structure
* @key: holds a private key
diff --git a/lib/x509/privkey_pkcs8.c b/lib/x509/privkey_pkcs8.c
index aa5f2897de..1f4529402d 100644
--- a/lib/x509/privkey_pkcs8.c
+++ b/lib/x509/privkey_pkcs8.c
@@ -1198,7 +1198,7 @@ static int decrypt_data(schema_id schema, ASN1_TYPE pkcs8_asn,
int result;
int data_size;
opaque *data = NULL, *key = NULL;
- gnutls_datum_t dkey, div;
+ gnutls_datum_t dkey, d_iv;
cipher_hd_t ch = NULL;
int key_size;
@@ -1265,9 +1265,9 @@ static int decrypt_data(schema_id schema, ASN1_TYPE pkcs8_asn,
dkey.data = key;
dkey.size = key_size;
- div.data = (opaque *) enc_params->iv;
- div.size = enc_params->iv_size;
- ch = _gnutls_cipher_init(enc_params->cipher, &dkey, &div);
+ d_iv.data = (opaque *) enc_params->iv;
+ d_iv.size = enc_params->iv_size;
+ ch = _gnutls_cipher_init(enc_params->cipher, &dkey, &d_iv);
gnutls_afree(key);
key = NULL;
@@ -1638,7 +1638,7 @@ static int encrypt_data(const gnutls_datum_t * plain,
int result;
int data_size;
opaque *data = NULL;
- gnutls_datum_t div;
+ gnutls_datum_t d_iv;
cipher_hd_t ch = NULL;
opaque pad, pad_size;
@@ -1665,9 +1665,9 @@ static int encrypt_data(const gnutls_datum_t * plain,
data_size = plain->size + pad;
- div.data = (opaque *) enc_params->iv;
- div.size = enc_params->iv_size;
- ch = _gnutls_cipher_init(enc_params->cipher, key, &div);
+ d_iv.data = (opaque *) enc_params->iv;
+ d_iv.size = enc_params->iv_size;
+ ch = _gnutls_cipher_init(enc_params->cipher, key, &d_iv);
if (ch == GNUTLS_CIPHER_FAILED) {
gnutls_assert();
diff --git a/lib/x509/x509.h b/lib/x509/x509.h
index 23c09c3d95..09da924937 100644
--- a/lib/x509/x509.h
+++ b/lib/x509/x509.h
@@ -126,9 +126,9 @@ 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 index,
+int gnutls_x509_crl_get_crt_serial(gnutls_x509_crl_t crl, int indx,
unsigned char *serial,
- size_t * serial_size, time_t * time);
+ size_t * serial_size, time_t * tim);
void gnutls_x509_crl_deinit(gnutls_x509_crl_t crl);
int gnutls_x509_crl_init(gnutls_x509_crl_t * crl);
diff --git a/lib/x509/xml.c b/lib/x509/xml.c
index 187b8d494d..8cb7c6075b 100644
--- a/lib/x509/xml.c
+++ b/lib/x509/xml.c
@@ -460,13 +460,11 @@ _gnutls_asn1_get_structure_xml(ASN1_TYPE structure,
len2 = _asn1_get_length_der(up->value, &len3);
if (len2 > 0 && strcmp(p->name, "type") == 0) {
- size_t len = sizeof(tmp);
+ size_t tmp_len = sizeof(tmp);
ret =
_gnutls_x509_oid_data2string(up->left->
- value,
- up->value +
- len3, len2,
- tmp, &len);
+ value, up->value + len3, len2,
+ tmp, &tmp_len);
if (ret >= 0) {
STR_APPEND(tmp);
diff --git a/libextra/opencdk/opencdk.h b/libextra/opencdk/opencdk.h
index 6ad55e650a..b8476d34b5 100644
--- a/libextra/opencdk/opencdk.h
+++ b/libextra/opencdk/opencdk.h
@@ -533,7 +533,7 @@ typedef struct cdk_packet_s *cdk_packet_t;
/* memory routines */
typedef void (*cdk_log_fnc_t) (void *, int, const char *, va_list);
void cdk_set_log_level (int lvl);
-void cdk_set_log_handler (cdk_log_fnc_t logfnc, void * opaque);
+void cdk_set_log_handler (cdk_log_fnc_t logfnc, void * opaq);
const char* cdk_strerror (int ec);
void cdk_set_malloc_hooks (void *(*new_alloc_func) (size_t n),
void *(*new_alloc_secure_func) (size_t n),