[glibmm] Tls[Database|Interaction|Passowrd]: Const corrections.
- From: Josà Alburquerque <jaalburqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Tls[Database|Interaction|Passowrd]: Const corrections.
- Date: Mon, 7 Jan 2013 21:23:23 +0000 (UTC)
commit 435d048309a118f59edd7011a7035aba18ddc78b
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date: Mon Jan 7 16:09:18 2013 -0500
Tls[Database|Interaction|Passowrd]: Const corrections.
* gio/src/tlsdatabase.hg (verify_chain):
(verify_chain_async): Accept the SocketConnectable as a const because
it is used to check for certificates that have been pinned (marked as
good) for a specific domain in a browser session and not modified.
(lookup_certificate_issuer)
(lookup_certificate_issuer_async): Accept the TlsCertificate for which
to look for the issuer as const because it is not modified according
to the docs.
* gio/src/tlsinteraction.hg (ask_password):
(ask_password_async)
(invoke_ask_password): Accept the TlsPassword as non-const because the
docs say that it is filled in by the methods, not used to compare a
user entry with an existing password.
* gio/src/tlspassword.hg (get_value_vfunc):
(get_default_warning_vfunc): Make these const because they are getter
functions.
* tools/m4/convert_gio.m4: Adjust the conversions according to above
changes.
ChangeLog | 23 +++++++++++++++++++++++
gio/src/tlsdatabase.hg | 14 +++++++-------
gio/src/tlsinteraction.hg | 17 +++++++++--------
gio/src/tlspassword.hg | 4 ++--
tools/m4/convert_gio.m4 | 2 +-
5 files changed, 42 insertions(+), 18 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c6e9a51..dc1de5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2013-01-07 Josà Alburquerque <jaalburquerque gmail com>
+
+ Tls[Database|Interaction|Passowrd]: Const corrections.
+
+ * gio/src/tlsdatabase.hg (verify_chain):
+ (verify_chain_async): Accept the SocketConnectable as a const because
+ it is used to check for certificates that have been pinned (marked as
+ good) for a specific domain in a browser session and not modified.
+ (lookup_certificate_issuer)
+ (lookup_certificate_issuer_async): Accept the TlsCertificate for which
+ to look for the issuer as const because it is not modified according
+ to the docs.
+ * gio/src/tlsinteraction.hg (ask_password):
+ (ask_password_async)
+ (invoke_ask_password): Accept the TlsPassword as non-const because the
+ docs say that it is filled in by the methods, not used to compare a
+ user entry with an existing password.
+ * gio/src/tlspassword.hg (get_value_vfunc):
+ (get_default_warning_vfunc): Make these const because they are getter
+ functions.
+ * tools/m4/convert_gio.m4: Adjust the conversions according to above
+ changes.
+
2013-01-07 Kjell Ahlstedt <kjell ahlstedt bredband net>
gmmproc: _WRAP_ENUM: Skip enum constants whose names are deleted.
diff --git a/gio/src/tlsdatabase.hg b/gio/src/tlsdatabase.hg
index 10f5e4a..fc64cce 100644
--- a/gio/src/tlsdatabase.hg
+++ b/gio/src/tlsdatabase.hg
@@ -54,14 +54,14 @@ public:
//TODO?: Have a constant for the C macro G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER (which is a string)?
//TODO?: Have a constant for the C macro G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT (which is a string)?
- _WRAP_METHOD(TlsCertificateFlags verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<SocketConnectable>& identity{?}, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseVerifyFlags flags{.} = TLS_DATABASE_VERIFY_NONE), g_tls_database_verify_chain, errthrow)
- _WRAP_METHOD(void verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<SocketConnectable>& identity{?}, const Glib::RefPtr<TlsInteraction>& interaction{?}, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseVerifyFlags flags{.} = TLS_DATABASE_VERIFY_NONE), g_tls_database_verify_chain_async, slot_name slot, slot_callback SignalProxy_async_callback)
+ _WRAP_METHOD(TlsCertificateFlags verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity{?}, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseVerifyFlags flags{.} = TLS_DATABASE_VERIFY_NONE), g_tls_database_verify_chain, errthrow)
+ _WRAP_METHOD(void verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity{?}, const Glib::RefPtr<TlsInteraction>& interaction{?}, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseVerifyFlags flags{.} = TLS_DATABASE_VERIFY_NONE), g_tls_database_verify_chain_async, slot_name slot, slot_callback SignalProxy_async_callback)
_WRAP_METHOD(TlsCertificateFlags verify_chain_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_database_verify_chain_finish, errthrow)
- _WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_issuer(const Glib::RefPtr<TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificate_issuer, errthrow)
- _WRAP_METHOD(Glib::RefPtr<const TlsCertificate> lookup_certificate_issuer(const Glib::RefPtr<TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE) const, g_tls_database_lookup_certificate_issuer, errthrow, constversion)
+ _WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_issuer(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificate_issuer, errthrow)
+ _WRAP_METHOD(Glib::RefPtr<const TlsCertificate> lookup_certificate_issuer(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE) const, g_tls_database_lookup_certificate_issuer, errthrow, constversion)
- _WRAP_METHOD(void lookup_certificate_issuer_async(const Glib::RefPtr<TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificate_issuer_async, slot_name slot, slot_callback SignalProxy_async_callback)
+ _WRAP_METHOD(void lookup_certificate_issuer_async(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificate_issuer_async, slot_name slot, slot_callback SignalProxy_async_callback)
_WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_issuer_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_database_lookup_certificate_issuer_finish, errthrow)
//TODO: _WRAP_METHOD(GList* lookup_certificates_issued_by(GByteArray* issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction, TlsDatabaseLookupFlags flags, const Glib::RefPtr<Cancellable>& cancellable), g_tls_database_lookup_certificates_issued_by, errthrow)
@@ -77,8 +77,8 @@ public:
_WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_for_handle_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_database_lookup_certificate_for_handle_finish, errthrow)
/* TODO:
- _WRAP_VFUNC(TlsCertificateFlags verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<SocketConnectable>& identity, const Glib::RefPtr<TlsInteraction>& interaction, TlsDatabaseVerifyFlags flags, const Glib::RefPtr<Cancellable>& cancellable), "verify_chain", errthrow)
- _WRAP_VFUNC(void verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<SocketConnectable>& identity, const Glib::RefPtr<TlsInteraction>& interaction, TlsDatabaseVerifyFlags flags, const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, gpointer user_data), "verify_chain_async")
+ _WRAP_VFUNC(TlsCertificateFlags verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const Glib::RefPtr<TlsInteraction>& interaction, TlsDatabaseVerifyFlags flags, const Glib::RefPtr<Cancellable>& cancellable), "verify_chain", errthrow)
+ _WRAP_VFUNC(void verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const Glib::RefPtr<TlsInteraction>& interaction, TlsDatabaseVerifyFlags flags, const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, gpointer user_data), "verify_chain_async")
_WRAP_VFUNC(TlsCertificateFlags verify_chain_finish(const Glib::RefPtr<AsyncResult>& result), "verify_chain_finish", errthrow)
_WRAP_VFUNC(Glib::ustring create_certificate_handle(const Glib::RefPtr<TlsCertificate>& certificate), "create_certificate_handle")
_WRAP_VFUNC(Glib::RefPtr<TlsCertificate> lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction, TlsDatabaseLookupFlags flags, const Glib::RefPtr<Cancellable>& cancellable), "lookup_certificate_for_handle", errthrow)
diff --git a/gio/src/tlsinteraction.hg b/gio/src/tlsinteraction.hg
index e9936a8..7310e36 100644
--- a/gio/src/tlsinteraction.hg
+++ b/gio/src/tlsinteraction.hg
@@ -30,7 +30,8 @@ class Cancellable;
class TlsPassword;
/** TlsInteraction - Interaction with the user during TLS operations.
- * TlsInteraction provides a mechanism for the TLS connection and database code to interact with the user. It can be used to ask the user for passwords.
+ * TlsInteraction provides a mechanism for the TLS connection and database code
+ * to interact with the user. It can be used to ask the user for passwords.
*
* To use a TlsInteraction with a TLS connection use
* Gio::TlsConnection::set_interaction().
@@ -44,10 +45,10 @@ class TlsPassword;
* thread is not running the main loop.
*
* Derived classes can choose to implement whichever interactions methods
- * they'd like to support by overriding those virtual methods in their class
- * initialization function. Any interactions not implemented will return
- * Gio::TLS_INTERACTION_UNHANDLED. If a derived class implements an async
- * method, it must also implement the corresponding finish method.
+ * they'd like to support by overriding those virtual methods. Any interactions
+ * not implemented will return Gio::TLS_INTERACTION_UNHANDLED. If a derived
+ * class implements an async method, it must also implement the corresponding
+ * finish method.
* @newin{2,36}
*/
class TlsInteraction : public Glib::Object
@@ -58,10 +59,10 @@ protected:
_CTOR_DEFAULT
public:
- _WRAP_METHOD(TlsInteractionResult ask_password(const Glib::RefPtr<const TlsPassword>& password, const Glib::RefPtr<Cancellable>& cancellable{?}), g_tls_interaction_ask_password, errthrow)
- _WRAP_METHOD(void ask_password_async(const Glib::RefPtr<const TlsPassword>& password, const SlotAsyncReady& slot{callback?}, const Glib::RefPtr<Cancellable>& cancellable{.?}), g_tls_interaction_ask_password_async, slot_name slot, slot_callback SignalProxy_async_callback)
+ _WRAP_METHOD(TlsInteractionResult ask_password(const Glib::RefPtr<TlsPassword>& password, const Glib::RefPtr<Cancellable>& cancellable{?}), g_tls_interaction_ask_password, errthrow)
+ _WRAP_METHOD(void ask_password_async(const Glib::RefPtr<TlsPassword>& password, const SlotAsyncReady& slot{callback?}, const Glib::RefPtr<Cancellable>& cancellable{.?}), g_tls_interaction_ask_password_async, slot_name slot, slot_callback SignalProxy_async_callback)
_WRAP_METHOD(TlsInteractionResult ask_password_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_interaction_ask_password_finish, errthrow)
- _WRAP_METHOD(TlsInteractionResult invoke_ask_password(const Glib::RefPtr<const TlsPassword>& password, const Glib::RefPtr<Cancellable>& cancellable{?}), g_tls_interaction_invoke_ask_password, errthrow)
+ _WRAP_METHOD(TlsInteractionResult invoke_ask_password(const Glib::RefPtr<TlsPassword>& password, const Glib::RefPtr<Cancellable>& cancellable{?}), g_tls_interaction_invoke_ask_password, errthrow)
/* TODO:
_WRAP_VFUNC(TlsInteractionResult ask_password(const Glib::RefPtr<TlsPassword>& password, const Glib::RefPtr<Cancellable>& cancellable), "ask_password", errthrow)
diff --git a/gio/src/tlspassword.hg b/gio/src/tlspassword.hg
index 34845a8..e9dfd70 100644
--- a/gio/src/tlspassword.hg
+++ b/gio/src/tlspassword.hg
@@ -61,12 +61,12 @@ public:
_WRAP_PROPERTY("warning", Glib::ustring)
#m4 _CONVERSION(`gsize*', `gsize&', `*($3)')
- _WRAP_VFUNC(const guchar* get_value(gsize& length), "get_value")
+ _WRAP_VFUNC(const guchar* get_value(gsize& length) const, "get_value")
//TODO: _WRAP_VFUNC(void set_value(guchar* value, gssize length, GDestroyNotify destroy), "set_value")
#m4 _CONVERSION(`Glib::ustring', `const gchar*', `g_strdup($3.c_str())')
- _WRAP_VFUNC(Glib::ustring get_default_warning(), "get_default_warning")
+ _WRAP_VFUNC(Glib::ustring get_default_warning() const, "get_default_warning")
};
} // namespace Gio
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index 91cc703..5893341 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -281,7 +281,7 @@ _CONVERSION(`const Glib::RefPtr<TlsInteraction>&',`GTlsInteraction*',`Glib::unwr
_CONVERSION(`GTlsInteraction*',`Glib::RefPtr<TlsInteraction>',`Glib::wrap($3)')
#TlsPassword
-_CONVERSION(`const Glib::RefPtr<const TlsPassword>&',`GTlsPassword*',`const_cast<GTlsPassword*>(Glib::unwrap($3))')
+_CONVERSION(`const Glib::RefPtr<TlsPassword>&',`GTlsPassword*',`Glib::unwrap($3)')
#UnixFDList
_CONVERSION(`GUnixFDList*',`Glib::RefPtr<UnixFDList>',`Glib::wrap($3)')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]