[glibmm] TlsDatabase: Const and optional parameter corrections.



commit a78c81b0a4e2c2b3293cf877faf00002d695b18b
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Fri Mar 22 00:12:15 2013 -0400

    TlsDatabase: Const and optional parameter corrections.
    
        * gio/src/tlsdatabase.hg: The "interaction" parameters in the methods
        are all optional (see the C API docs).
        (verify_chain):
        (verify_chain_async):
        (verify_chain_vfunc):
        (verify_chain_async_vfunc): Make these methods const because the
        database should not be changed by verifying a certificate's chain.
        (create_certificate_handle_vfunc): Make the certificate constant
        because it should not change when creating a handle for it.

 ChangeLog              |   14 ++++++++++++++
 gio/src/tlsdatabase.hg |   29 +++++++++++++++--------------
 2 files changed, 29 insertions(+), 14 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 44beab3..9f35538 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2013-03-22  José Alburquerque  <jaalburquerque gmail com>
+
+       TlsDatabase: Const and optional parameter corrections.
+
+       * gio/src/tlsdatabase.hg: The "interaction" parameters in the methods
+       are all optional (see the C API docs).
+       (verify_chain):
+       (verify_chain_async):
+       (verify_chain_vfunc):
+       (verify_chain_async_vfunc): Make these methods const because the
+       database should not be changed by verifying a certificate's chain.
+       (create_certificate_handle_vfunc): Make the certificate constant
+       because it should not change when creating a handle for it.
+
 2013-03-21  José Alburquerque  <jaalburquerque gmail com>
 
        TlsConnection: Correct its base class derivation.
diff --git a/gio/src/tlsdatabase.hg b/gio/src/tlsdatabase.hg
index 2463491..4653eb2 100644
--- a/gio/src/tlsdatabase.hg
+++ b/gio/src/tlsdatabase.hg
@@ -63,45 +63,46 @@ 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<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(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) const, 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) const, 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<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(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<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(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)
 
 #m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<TlsCertificate> >',`Glib::ListHandler< 
Glib::RefPtr<TlsCertificate> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
-  _WRAP_METHOD(std::vector< Glib::RefPtr<TlsCertificate> > lookup_certificates_issued_by(const 
Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction, const 
Glib::RefPtr<Cancellable>& cancellable{.}, TlsDatabaseLookupFlags flags{.} = Gio::TLS_DATABASE_LOOKUP_NONE), 
g_tls_database_lookup_certificates_issued_by, errthrow)
+  _WRAP_METHOD(std::vector< Glib::RefPtr<TlsCertificate> > lookup_certificates_issued_by(const 
Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction{?}, const 
Glib::RefPtr<Cancellable>& cancellable{.}, TlsDatabaseLookupFlags flags{.} = Gio::TLS_DATABASE_LOOKUP_NONE), 
g_tls_database_lookup_certificates_issued_by, errthrow)
 
 #m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<const TlsCertificate> >',`Glib::ListHandler< 
Glib::RefPtr<const TlsCertificate> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
-  _WRAP_METHOD(std::vector< Glib::RefPtr<const TlsCertificate> > lookup_certificates_issued_by(const 
Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction, const 
Glib::RefPtr<Cancellable>& cancellable{.}, TlsDatabaseLookupFlags flags{.} = Gio::TLS_DATABASE_LOOKUP_NONE) 
const, g_tls_database_lookup_certificates_issued_by, errthrow)
+  _WRAP_METHOD(std::vector< Glib::RefPtr<const TlsCertificate> > lookup_certificates_issued_by(const 
Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction{?}, const 
Glib::RefPtr<Cancellable>& cancellable{.}, TlsDatabaseLookupFlags flags{.} = Gio::TLS_DATABASE_LOOKUP_NONE) 
const, g_tls_database_lookup_certificates_issued_by, errthrow)
 
-  _WRAP_METHOD(void lookup_certificates_issued_by_async(const Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, 
const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot{callback}, const 
Glib::RefPtr<Cancellable>& cancellable{.}, TlsDatabaseLookupFlags flags{.} = Gio::TLS_DATABASE_LOOKUP_NONE), 
g_tls_database_lookup_certificates_issued_by_async, slot_name slot, slot_callback SignalProxy_async_callback)
+  _WRAP_METHOD(void lookup_certificates_issued_by_async(const Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, 
const Glib::RefPtr<TlsInteraction>& interaction{?}, const SlotAsyncReady& slot{callback}, const 
Glib::RefPtr<Cancellable>& cancellable{.}, TlsDatabaseLookupFlags flags{.} = Gio::TLS_DATABASE_LOOKUP_NONE), 
g_tls_database_lookup_certificates_issued_by_async, slot_name slot, slot_callback SignalProxy_async_callback)
   _WRAP_METHOD(std::vector< Glib::RefPtr<TlsCertificate> > lookup_certificates_issued_by_finish(const 
Glib::RefPtr<AsyncResult>& result), g_tls_database_lookup_certificates_issued_by_finish, errthrow)
 
   _WRAP_METHOD(Glib::ustring create_certificate_handle(const Glib::RefPtr<const TlsCertificate>& 
certificate) const, g_tls_database_create_certificate_handle)
 
-  _WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_for_handle(const Glib::ustring& handle, const 
Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, 
TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificate_for_handle, 
errthrow)
-  _WRAP_METHOD(Glib::RefPtr<const TlsCertificate> lookup_certificate_for_handle(const Glib::ustring& handle, 
const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, 
TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE) const, 
g_tls_database_lookup_certificate_for_handle, errthrow, constversion)
+  _WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_for_handle(const Glib::ustring& handle, const 
Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, 
TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificate_for_handle, 
errthrow)
+  _WRAP_METHOD(Glib::RefPtr<const TlsCertificate> lookup_certificate_for_handle(const Glib::ustring& handle, 
const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, 
TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE) const, 
g_tls_database_lookup_certificate_for_handle, errthrow, constversion)
 
-  _WRAP_METHOD(void lookup_certificate_for_handle_async(const Glib::ustring& handle, 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_for_handle_async, slot_name slot, slot_callback SignalProxy_async_callback)
+  _WRAP_METHOD(void lookup_certificate_for_handle_async(const Glib::ustring& handle, 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_for_handle_async, slot_name slot, slot_callback SignalProxy_async_callback)
   _WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_for_handle_finish(const 
Glib::RefPtr<AsyncResult>& result), g_tls_database_lookup_certificate_for_handle_finish, errthrow)
 
 #m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr<TlsCertificate>&',`Glib::wrap($3, true)')
 #m4 _CONVERSION(`GSocketConnectable*',`const Glib::RefPtr<const SocketConnectable>&',`Glib::wrap($3, true)')
 #m4 _CONVERSION(`GTlsInteraction*',`const Glib::RefPtr<TlsInteraction>&',`Glib::wrap($3, true)')
 
-  _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, const Glib::RefPtr<Cancellable>& cancellable{.}, 
TlsDatabaseVerifyFlags flags{.}), "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, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.}, 
TlsDatabaseVerifyFlags flags{.}), "verify_chain_async", slot_name slot, slot_callback 
SignalProxy_async_callback)
+  _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, const Glib::RefPtr<Cancellable>& cancellable{.}, 
TlsDatabaseVerifyFlags flags{.}) const, "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, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.}, 
TlsDatabaseVerifyFlags flags{.}) const, "verify_chain_async", slot_name slot, slot_callback 
SignalProxy_async_callback)
 
 #m4 _CONVERSION(`GAsyncResult*',`const Glib::RefPtr<AsyncResult>&',`Glib::wrap($3, true)')
 
   _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) 
const, "create_certificate_handle")
+#m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr<const TlsCertificate>&',`Glib::wrap($3, true)')
+  _WRAP_VFUNC(Glib::ustring create_certificate_handle(const Glib::RefPtr<const TlsCertificate>& certificate) 
const, "create_certificate_handle")
 
 #m4 
_CONVERSION(`Glib::RefPtr<TlsCertificate>',`GTlsCertificate*',`G_TLS_CERTIFICATE(g_object_ref(Glib::unwrap($3)))')
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]