* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
*
*/
-#ifndef QCRYPTO_TLS_SESSION_H__
-#define QCRYPTO_TLS_SESSION_H__
+#ifndef QCRYPTO_TLSSESSION_H
+#define QCRYPTO_TLSSESSION_H
#include "crypto/tlscreds.h"
*
* static int mysock_run_tls(int sockfd,
* QCryptoTLSCreds *creds,
- * Error *erp)
+ * Error **errp)
* {
* QCryptoTLSSession *sess;
*
* @hostname: optional hostname to validate
* @aclname: optional ACL to validate peer credentials against
* @endpoint: role of the TLS session, client or server
- * @errp: pointer to an uninitialized error object
+ * @errp: pointer to a NULL-initialized error object
*
* Create a new TLS session object that will be used to
* negotiate a TLS session over an arbitrary data channel.
*/
void qcrypto_tls_session_free(QCryptoTLSSession *sess);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoTLSSession, qcrypto_tls_session_free)
+
/**
* qcrypto_tls_session_check_credentials:
* @sess: the TLS session object
- * @errp: pointer to an uninitialized error object
+ * @errp: pointer to a NULL-initialized error object
*
* Validate the peer's credentials after a successful
* TLS handshake. It is an error to call this before
/**
* qcrypto_tls_session_handshake:
* @sess: the TLS session object
- * @errp: pointer to an uninitialized error object
+ * @errp: pointer to a NULL-initialized error object
*
* Start, or continue, a TLS handshake sequence. If
* the underlying data channel is non-blocking, then
/**
* qcrypto_tls_session_get_key_size:
* @sess: the TLS session object
- * @errp: pointer to an uninitialized error object
+ * @errp: pointer to a NULL-initialized error object
*
* Check the size of the data channel encryption key
*
*/
char *qcrypto_tls_session_get_peer_name(QCryptoTLSSession *sess);
-#endif /* QCRYPTO_TLS_SESSION_H__ */
+#endif /* QCRYPTO_TLSSESSION_H */