From 7c7ea6be066eea8b479cd8583a2c162de6097074 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Thu, 8 Dec 2016 13:00:30 -0200 Subject: [PATCH] efl_net_ssl_context: check and document constructor only properties. The context is shared and thus these lists should be static once object is created. --- src/lib/ecore_con/efl_net_ssl_context.c | 5 +++++ src/lib/ecore_con/efl_net_ssl_context.eo | 25 +++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/lib/ecore_con/efl_net_ssl_context.c b/src/lib/ecore_con/efl_net_ssl_context.c index 22c5ad882c..5779ff1e63 100644 --- a/src/lib/ecore_con/efl_net_ssl_context.c +++ b/src/lib/ecore_con/efl_net_ssl_context.c @@ -159,6 +159,7 @@ _efl_net_ssl_context_certificates_get(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Dat static void _efl_net_ssl_context_certificates_set(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd, Eina_Iterator *it) { + EINA_SAFETY_ON_TRUE_RETURN(efl_finalized_get(o)); _efl_net_ssl_context_string_list_free(&pd->certificates); pd->certificates = _efl_net_ssl_context_string_iter_to_list(it); } @@ -172,6 +173,7 @@ _efl_net_ssl_context_private_keys_get(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Dat static void _efl_net_ssl_context_private_keys_set(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd, Eina_Iterator *it) { + EINA_SAFETY_ON_TRUE_RETURN(efl_finalized_get(o)); _efl_net_ssl_context_string_list_free(&pd->private_keys); pd->private_keys = _efl_net_ssl_context_string_iter_to_list(it); } @@ -185,6 +187,7 @@ _efl_net_ssl_context_certificate_revogation_lists_get(Eo *o EINA_UNUSED, Efl_Net static void _efl_net_ssl_context_certificate_revogation_lists_set(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd, Eina_Iterator *it) { + EINA_SAFETY_ON_TRUE_RETURN(efl_finalized_get(o)); _efl_net_ssl_context_string_list_free(&pd->certificate_revogation_lists); pd->certificate_revogation_lists = _efl_net_ssl_context_string_iter_to_list(it); } @@ -198,6 +201,7 @@ _efl_net_ssl_context_certificate_authorities_get(Eo *o EINA_UNUSED, Efl_Net_Ssl_ static void _efl_net_ssl_context_certificate_authorities_set(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd, Eina_Iterator *it) { + EINA_SAFETY_ON_TRUE_RETURN(efl_finalized_get(o)); _efl_net_ssl_context_string_list_free(&pd->certificate_authorities); pd->certificate_authorities = _efl_net_ssl_context_string_iter_to_list(it); } @@ -211,6 +215,7 @@ _efl_net_ssl_context_default_paths_load_get(Eo *o EINA_UNUSED, Efl_Net_Ssl_Conte static void _efl_net_ssl_context_default_paths_load_set(Eo *o EINA_UNUSED, Efl_Net_Ssl_Context_Data *pd, Eina_Bool load_defaults) { + EINA_SAFETY_ON_TRUE_RETURN(efl_finalized_get(o)); pd->load_defaults = load_defaults; } diff --git a/src/lib/ecore_con/efl_net_ssl_context.eo b/src/lib/ecore_con/efl_net_ssl_context.eo index 8549cdd09d..d9808432f4 100644 --- a/src/lib/ecore_con/efl_net_ssl_context.eo +++ b/src/lib/ecore_con/efl_net_ssl_context.eo @@ -43,35 +43,50 @@ class Efl.Net.Ssl.Context (Efl.Object) { } @property certificates { - [[The list of paths to certificates to use.]] + [[The list of paths to certificates to use. + + Can only be set during object construction! + ]] values { paths: free(own(iterator), eina_iterator_free); [[Path list for certificates]] } } @property private_keys { - [[The list of paths to private keys to use.]] + [[The list of paths to private keys to use. + + Can only be set during object construction! + ]] values { paths: free(own(iterator), eina_iterator_free); [[Path list for private keys]] } } @property certificate_revogation_lists { - [[The list of paths to CRL (certificate revogation list) to use.]] + [[The list of paths to CRL (certificate revogation list) to use. + + Can only be set during object construction! + ]] values { paths: free(own(iterator), eina_iterator_free); [[Path list for CRL's]] } } @property certificate_authorities { - [[The list of paths to CA (certificate authoritie) to use.]] + [[The list of paths to CA (certificate authoritie) to use. + + Can only be set during object construction! + ]] values { paths: free(own(iterator), eina_iterator_free); [[Path list for CA's]] } } @property default_paths_load { - [[If $true, will use system's default certificate storage]] + [[If $true, will use system's default certificate storage + + Can only be set during object construction! + ]] values { default_paths_load: bool; [[$if true use system default paths for loading, $false otherwise]] }