/* Openpgp certificate stuff
*/
-typedef int (*gnutls_openpgp_recv_key_func)(gnutls_session_t, const unsigned char *keyfpr,
- unsigned int keyfpr_length, gnutls_datum_t *key);
+/**
+ * gnutls_openpgp_recv_key_func - Callback prototype to get OpenPGP keys
+ * @session: a TLS session
+ * @keyfpr: key fingerprint
+ * @keyfpr_length: length of key fingerprint
+ * @key: output key.
+ *
+ * A callback of this type is used to retrieve OpenPGP keys. Only
+ * useful on the server, and will only be used if the peer send a key
+ * fingerprint instead of a full key. See also
+ * gnutls_openpgp_set_recv_key_function().
+ *
+ */
+typedef int (*gnutls_openpgp_recv_key_func) (gnutls_session_t session,
+ const unsigned char *keyfpr,
+ unsigned int keyfpr_length,
+ gnutls_datum_t *key);
void gnutls_openpgp_set_recv_key_function( gnutls_session_t session,
gnutls_openpgp_recv_key_func func);
}
-/* Sends the appropriate alert, depending
- * on the error message. Deprecated. May be removed.
+/**
+ * gnutls_alert_send_appropriate - This function sends an alert to the peer depending on the error code
+ * @session: is a &gnutls_session_t structure.
+ * @err: is an integer
+ *
+ * This function is DEPRECATED, and may be removed.
+ *
+ * Sends an alert to the peer depending on the error code returned by a gnutls
+ * function. This function will call gnutls_error_to_alert() to determine
+ * the appropriate alert to send.
+ *
+ * This function may also return GNUTLS_E_AGAIN, or GNUTLS_E_INTERRUPTED.
+ *
+ * If the return value is GNUTLS_E_INVALID_REQUEST, then no alert has
+ * been sent to the peer.
*/
-/*-
- * gnutls_alert_send_appropriate - This function sends an alert to the peer depending on the error code
- * @session: is a &gnutls_session_t structure.
- * @err: is an integer
- *
- * Sends an alert to the peer depending on the error code returned by a gnutls
- * function. This function will call gnutls_error_to_alert() to determine
- * the appropriate alert to send.
- *
- * This function may also return GNUTLS_E_AGAIN, or GNUTLS_E_INTERRUPTED.
- *
- * If the return value is GNUTLS_E_INVALID_REQUEST, then no alert has
- * been sent to the peer.
- *
- -*/
int gnutls_alert_send_appropriate(gnutls_session_t session, int err)
{
int alert;
return s; /* patchlevel */
}
-/****************
- * Check that the version of the library is at minimum the requested one
- * and return the version string; return NULL if the condition is not
- * satisfied. If a NULL is passed to this function, no check is done,
- * but the version string is simply returned.
- */
+/**
+ * gnutls_extra_check_version - This function checks the library's version
+ * @req_version: the version to check
+ *
+ * Check that the version of the gnutls-extra library is at minimum
+ * the requested one and return the version string; return NULL if the
+ * condition is not satisfied. If a NULL is passed to this function,
+ * no check is done, but the version string is simply returned.
+ *
+ **/
const char *gnutls_extra_check_version(const char *req_version)
{
const char *ver = VERSION;
return gnutls_openpgp_add_keyring_file(&c->keyring, file);
}
-
+/**
+ * gnutls_certificate_set_openpgp_keyring_mem - Add keyring data for OpenPGP
+ * @c: A certificate credentials structure
+ * @data: buffer with keyring data.
+ * @dlen: length of data buffer.
+ *
+ * The function is used to set keyrings that will be used internally
+ * by various OpenPGP functions. For example to find a key when it
+ * is needed for an operations. The keyring will also be used at the
+ * verification functions.
+ *
+ **/
int
gnutls_certificate_set_openpgp_keyring_mem(gnutls_certificate_credentials_t c,
const opaque * data,