]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Thu Jan 8 13:04:03 CST 2009 Pekka Pessi <first.last@nokia.com>
authorMichael Jerris <mike@jerris.com>
Wed, 11 Feb 2009 16:18:36 +0000 (16:18 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 11 Feb 2009 16:18:36 +0000 (16:18 +0000)
  * auth_client: do not crash with unknown authentication schemes

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11779 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c
libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client_plugin.h

index f3382220abce263606e1efbd4b6606e4e160cc19..6b6f901a57a80f0df2373a1da903fa8a4704859e 100644 (file)
@@ -1 +1 @@
-Wed Feb 11 10:16:40 CST 2009
+Wed Feb 11 10:18:18 CST 2009
index 20d1287204c8522d1aa9c8eee514dd1bf7cf0d93..1feb81d66de4f7fe06113e52bf41c68f46c70c56 100644 (file)
@@ -128,11 +128,17 @@ int auc_challenge(auth_client_t **auc_list,
     if (!matched) {
       /* There was no matching authenticator, create a new one */
       *cca = ca_create(home, scheme, realm);
-      if (ca_challenge((*cca), ch, crcl, scheme, realm) < 0) {
+
+      if (*cca == NULL) {
+       return -1;
+      }
+      else if (ca_challenge((*cca), ch, crcl, scheme, realm) < 0) {
        ca_destroy(home, *cca), *cca = NULL;
        return -1;
       }
-      retval = 1;              /* Updated authenticator */
+      /* XXX - case w/ unknown authentication scheme */
+      else
+       retval = 1;             /* Updated authenticator */
     }
   }
 
index 36104ec8bde3fb8f1f44c301ada77417857b713a..cc1d2d83cf7d60fd56be69b9820ab11f5131475b 100644 (file)
@@ -98,7 +98,8 @@ struct auth_client_plugin
 
 /** Check if authentication client has been extended. @NEW_1_12_6. */
 #define AUTH_CLIENT_IS_EXTENDED(ca)                                    \
-  ((ca)->ca_auc->auc_plugin_size >                                     \
+  ((ca)->ca_auc &&                                                     \
+   (ca)->ca_auc->auc_plugin_size >                                     \
    (int)offsetof(auth_client_plugin_t, auc_clear)                      \
    && (ca)->ca_auc->auc_clear != NULL)