summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2010-04-14 14:50:30 +0200
committerSimon Josefsson <simon@josefsson.org>2010-04-14 14:50:30 +0200
commit705aa8cd3da09abedd6eb5d0d55610b644e4f98d (patch)
tree71bec16c5a6acb4fc926d74802ca5561b1cd2f9b /lib
parente543db08dc98d497d95fc41e46f2b891dfb04f0a (diff)
downloadgnutls-705aa8cd3da09abedd6eb5d0d55610b644e4f98d.tar.gz
Export new ABIs. Doc fixes for new APIs.
Diffstat (limited to 'lib')
-rw-r--r--lib/crypto-api.c141
-rw-r--r--lib/ext_safe_renegotiation.c16
-rw-r--r--lib/gnutls_algorithms.c11
-rw-r--r--lib/gnutls_cert.c9
-rw-r--r--lib/libgnutls.map3
-rw-r--r--lib/x509/x509.c1
6 files changed, 122 insertions, 59 deletions
diff --git a/lib/crypto-api.c b/lib/crypto-api.c
index b2c724e58e..453b8c1170 100644
--- a/lib/crypto-api.c
+++ b/lib/crypto-api.c
@@ -43,20 +43,22 @@
* accelerator in use.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
int
gnutls_cipher_init (gnutls_cipher_hd_t * handle,
gnutls_cipher_algorithm_t cipher,
- const gnutls_datum_t * key,
- const gnutls_datum_t * iv)
+ const gnutls_datum_t * key, const gnutls_datum_t * iv)
{
- *handle = gnutls_malloc(sizeof(cipher_hd_st));
- if (*handle == NULL) {
- gnutls_assert();
- return GNUTLS_E_MEMORY_ERROR;
- }
-
- return _gnutls_cipher_init(((cipher_hd_st*)*handle), cipher, key, iv);
+ *handle = gnutls_malloc (sizeof (cipher_hd_st));
+ if (*handle == NULL)
+ {
+ gnutls_assert ();
+ return GNUTLS_E_MEMORY_ERROR;
+ }
+
+ return _gnutls_cipher_init (((cipher_hd_st *) * handle), cipher, key, iv);
}
/**
@@ -69,10 +71,13 @@ gnutls_cipher_init (gnutls_cipher_hd_t * handle,
* specified by the context.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
-int gnutls_cipher_encrypt (gnutls_cipher_hd_t handle, void *text, int textlen)
+int
+gnutls_cipher_encrypt (gnutls_cipher_hd_t handle, void *text, int textlen)
{
- return _gnutls_cipher_encrypt((cipher_hd_st*)handle, text, textlen);
+ return _gnutls_cipher_encrypt ((cipher_hd_st *) handle, text, textlen);
}
/**
@@ -85,13 +90,15 @@ int gnutls_cipher_encrypt (gnutls_cipher_hd_t handle, void *text, int textlen)
* specified by the context.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
int
gnutls_cipher_decrypt (gnutls_cipher_hd_t handle, void *ciphertext,
- int ciphertextlen)
+ int ciphertextlen)
{
- return _gnutls_cipher_decrypt((cipher_hd_st*)handle, ciphertext,
- ciphertextlen);
+ return _gnutls_cipher_decrypt ((cipher_hd_st *) handle, ciphertext,
+ ciphertextlen);
}
/**
@@ -100,11 +107,13 @@ gnutls_cipher_decrypt (gnutls_cipher_hd_t handle, void *ciphertext,
*
* This function will deinitialize all resources occupied by the given
* encryption context.
+ *
+ * Since: 2.10.0
**/
void
gnutls_cipher_deinit (gnutls_cipher_hd_t handle)
{
- return _gnutls_cipher_deinit((cipher_hd_st*)handle);
+ return _gnutls_cipher_deinit ((cipher_hd_st *) handle);
}
@@ -123,19 +132,22 @@ gnutls_cipher_deinit (gnutls_cipher_hd_t handle)
* cryptographic accelerator in use.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
int
gnutls_hmac_init (gnutls_hmac_hd_t * dig,
gnutls_digest_algorithm_t algorithm,
const void *key, int keylen)
{
- *dig = gnutls_malloc(sizeof(digest_hd_st));
- if (*dig == NULL) {
- gnutls_assert();
- return GNUTLS_E_MEMORY_ERROR;
- }
+ *dig = gnutls_malloc (sizeof (digest_hd_st));
+ if (*dig == NULL)
+ {
+ gnutls_assert ();
+ return GNUTLS_E_MEMORY_ERROR;
+ }
- return _gnutls_hmac_init(((digest_hd_st*)*dig), algorithm, key, keylen);
+ return _gnutls_hmac_init (((digest_hd_st *) * dig), algorithm, key, keylen);
}
/**
@@ -148,10 +160,13 @@ gnutls_hmac_init (gnutls_hmac_hd_t * dig,
* specified by the context.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
-int gnutls_hmac (gnutls_hmac_hd_t handle, const void *text, size_t textlen)
+int
+gnutls_hmac (gnutls_hmac_hd_t handle, const void *text, size_t textlen)
{
- return _gnutls_hmac((digest_hd_st*)handle, text, textlen);
+ return _gnutls_hmac ((digest_hd_st *) handle, text, textlen);
}
/**
@@ -160,11 +175,13 @@ int gnutls_hmac (gnutls_hmac_hd_t handle, const void *text, size_t textlen)
* @digest: is the output value of the MAC
*
* This function will output the current MAC value.
+ *
+ * Since: 2.10.0
**/
void
gnutls_hmac_output (gnutls_hmac_hd_t handle, void *digest)
{
- return _gnutls_hmac_output((digest_hd_st*)handle, digest);
+ return _gnutls_hmac_output ((digest_hd_st *) handle, digest);
}
/**
@@ -174,10 +191,13 @@ gnutls_hmac_output (gnutls_hmac_hd_t handle, void *digest)
*
* This function will deinitialize all resources occupied by
* the given hmac context.
+ *
+ * Since: 2.10.0
**/
-void gnutls_hmac_deinit (gnutls_hmac_hd_t handle, void *digest)
+void
+gnutls_hmac_deinit (gnutls_hmac_hd_t handle, void *digest)
{
- _gnutls_hmac_deinit((digest_hd_st*)handle, digest);
+ _gnutls_hmac_deinit ((digest_hd_st *) handle, digest);
}
/**
@@ -189,10 +209,12 @@ void gnutls_hmac_deinit (gnutls_hmac_hd_t handle, void *digest)
*
* Returns: The length or zero on error.
*
+ * Since: 2.10.0
**/
-int gnutls_hmac_get_len( gnutls_mac_algorithm_t algorithm)
+int
+gnutls_hmac_get_len (gnutls_mac_algorithm_t algorithm)
{
- return _gnutls_hmac_get_algo_len(algorithm);
+ return _gnutls_hmac_get_algo_len (algorithm);
}
/**
@@ -208,12 +230,15 @@ int gnutls_hmac_get_len( gnutls_mac_algorithm_t algorithm)
* on a single call.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
-int gnutls_hmac_fast (gnutls_mac_algorithm_t algorithm,
- const void* key, int keylen,
- const void* text, size_t textlen, void* digest)
+int
+gnutls_hmac_fast (gnutls_mac_algorithm_t algorithm,
+ const void *key, int keylen,
+ const void *text, size_t textlen, void *digest)
{
- return _gnutls_hmac_fast(algorithm, key, keylen, text, textlen, digest);
+ return _gnutls_hmac_fast (algorithm, key, keylen, text, textlen, digest);
}
/* HASH */
@@ -229,17 +254,20 @@ int gnutls_hmac_fast (gnutls_mac_algorithm_t algorithm,
* accelerator in use.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
-int gnutls_hash_init (gnutls_hash_hd_t * dig,
- gnutls_digest_algorithm_t algorithm)
+int
+gnutls_hash_init (gnutls_hash_hd_t * dig, gnutls_digest_algorithm_t algorithm)
{
- *dig = gnutls_malloc(sizeof(digest_hd_st));
- if (*dig == NULL) {
- gnutls_assert();
- return GNUTLS_E_MEMORY_ERROR;
- }
+ *dig = gnutls_malloc (sizeof (digest_hd_st));
+ if (*dig == NULL)
+ {
+ gnutls_assert ();
+ return GNUTLS_E_MEMORY_ERROR;
+ }
- return _gnutls_hash_init(((digest_hd_st*)*dig), algorithm);
+ return _gnutls_hash_init (((digest_hd_st *) * dig), algorithm);
}
/**
@@ -252,10 +280,13 @@ int gnutls_hash_init (gnutls_hash_hd_t * dig,
* specified by the context.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
-int gnutls_hash (gnutls_hash_hd_t handle, const void *text, size_t textlen)
+int
+gnutls_hash (gnutls_hash_hd_t handle, const void *text, size_t textlen)
{
- return _gnutls_hash((digest_hd_st*)handle, text, textlen);
+ return _gnutls_hash ((digest_hd_st *) handle, text, textlen);
}
/**
@@ -264,10 +295,13 @@ int gnutls_hash (gnutls_hash_hd_t handle, const void *text, size_t textlen)
* @digest: is the output value of the hash
*
* This function will output the current hash value.
+ *
+ * Since: 2.10.0
**/
-void gnutls_hash_output (gnutls_hash_hd_t handle, void *digest)
+void
+gnutls_hash_output (gnutls_hash_hd_t handle, void *digest)
{
- return _gnutls_hash_output((digest_hd_st*)handle, digest);
+ return _gnutls_hash_output ((digest_hd_st *) handle, digest);
}
/**
@@ -277,11 +311,13 @@ void gnutls_hash_output (gnutls_hash_hd_t handle, void *digest)
*
* This function will deinitialize all resources occupied by
* the given hash context.
+ *
+ * Since: 2.10.0
**/
void
gnutls_hash_deinit (gnutls_hash_hd_t handle, void *digest)
{
- _gnutls_hash_deinit((digest_hd_st*)handle, digest);
+ _gnutls_hash_deinit ((digest_hd_st *) handle, digest);
}
/**
@@ -293,10 +329,12 @@ gnutls_hash_deinit (gnutls_hash_hd_t handle, void *digest)
*
* Returns: The length or zero on error.
*
+ * Since: 2.10.0
**/
-int gnutls_hash_get_len( gnutls_digest_algorithm_t algorithm)
+int
+gnutls_hash_get_len (gnutls_digest_algorithm_t algorithm)
{
- return _gnutls_hash_get_algo_len(algorithm);
+ return _gnutls_hash_get_algo_len (algorithm);
}
/**
@@ -310,9 +348,12 @@ int gnutls_hash_get_len( gnutls_digest_algorithm_t algorithm)
* on a single call.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
-int gnutls_hash_fast (gnutls_digest_algorithm_t algorithm,
- const void *text, size_t textlen, void *digest)
+int
+gnutls_hash_fast (gnutls_digest_algorithm_t algorithm,
+ const void *text, size_t textlen, void *digest)
{
- return _gnutls_hash_fast(algorithm, text, textlen, digest);
+ return _gnutls_hash_fast (algorithm, text, textlen, digest);
}
diff --git a/lib/ext_safe_renegotiation.c b/lib/ext_safe_renegotiation.c
index bb22a7121d..fe29f998a7 100644
--- a/lib/ext_safe_renegotiation.c
+++ b/lib/ext_safe_renegotiation.c
@@ -122,11 +122,13 @@ _gnutls_safe_renegotiation_send_params (gnutls_session_t session,
* @session: is a #gnutls_session_t structure.
* @value: 0 to disable and 1 to enable
*
- * Used to enable and disable initial safe renegotiation for the current
- * session. By default it is allowed for a client to not advertise safe
- * renegotiation capability but there might be cases where signalling
- * a client of its insecurity by rejecting session might be beneficial.
- * This option has meaning only in server side.
+ * Used to enable and disable initial safe renegotiation for the
+ * current session. By default it is allowed for a client to not
+ * advertise safe renegotiation capability but there might be cases
+ * where signalling a client of its insecurity by rejecting session
+ * might be beneficial. This option has meaning only in server side.
+ *
+ * Since: 2.10.0
**/
void
gnutls_safe_negotiation_set_initial (gnutls_session_t session, int value)
@@ -143,6 +145,8 @@ gnutls_safe_negotiation_set_initial (gnutls_session_t session, int value)
* session. Normally you shouldn't cope with this function since the
* default (enable) is sufficient, but there might be servers that
* cannot handle or correctly handle the extension.
+ *
+ * Since: 2.10.0
**/
void
gnutls_safe_renegotiation_set (gnutls_session_t session, int value)
@@ -159,6 +163,8 @@ gnutls_safe_renegotiation_set (gnutls_session_t session, int value)
*
* Returns: 0 when safe renegotiation is not used and non zero when
* safe renegotiation is used.
+ *
+ * Since: 2.10.0
**/
int
gnutls_safe_renegotiation_status (gnutls_session_t session)
diff --git a/lib/gnutls_algorithms.c b/lib/gnutls_algorithms.c
index 0e2faca607..d1ecebb5be 100644
--- a/lib/gnutls_algorithms.c
+++ b/lib/gnutls_algorithms.c
@@ -814,6 +814,17 @@ _gnutls_mac_is_ok (gnutls_mac_algorithm_t algorithm)
}
/* CIPHER functions */
+
+/**
+ * gnutls_cipher_get_block_size:
+ * @algorithm: is an encryption algorithm
+ *
+ * Get block size for encryption algorithm.
+ *
+ * Returns: block size for encryption algorithm.
+ *
+ * Since: 2.10.0
+ **/
int
gnutls_cipher_get_block_size (gnutls_cipher_algorithm_t algorithm)
{
diff --git a/lib/gnutls_cert.c b/lib/gnutls_cert.c
index f4e59e021e..42a8b9675b 100644
--- a/lib/gnutls_cert.c
+++ b/lib/gnutls_cert.c
@@ -445,10 +445,13 @@ void gnutls_certificate_server_set_retrieve_function
*
* The callback function should return 0 for the handshake to continue
* or non-zero to terminate.
+ *
+ * Since: 2.10.0
**/
-void gnutls_certificate_set_verify_function
- (gnutls_certificate_credentials_t cred,
- gnutls_certificate_verify_function * func)
+void
+gnutls_certificate_set_verify_function
+(gnutls_certificate_credentials_t cred,
+ gnutls_certificate_verify_function * func)
{
cred->verify_callback = func;
}
diff --git a/lib/libgnutls.map b/lib/libgnutls.map
index a69a39514f..5dfc75d884 100644
--- a/lib/libgnutls.map
+++ b/lib/libgnutls.map
@@ -599,6 +599,9 @@ GNUTLS_2_10
gnutls_hmac_deinit;
gnutls_hmac_output;
gnutls_certificate_set_verify_function;
+ gnutls_safe_negotiation_set_initial;
+ gnutls_safe_renegotiation_set;
+ gnutls_safe_renegotiation_status;
} GNUTLS_2_8;
GNUTLS_PRIVATE {
diff --git a/lib/x509/x509.c b/lib/x509/x509.c
index 8d27e71d6b..173cbc1280 100644
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -1399,7 +1399,6 @@ gnutls_x509_crt_get_subject_alt_othername_oid (gnutls_x509_crt_t cert,
* %GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE is returned.
*
* Since: 2.10.0
- *
**/
int
gnutls_x509_crt_get_issuer_alt_othername_oid (gnutls_x509_crt_t cert,