Fixed ticket #279: Bug with authenticating STUN response causes STUN responses to be dropped

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1284 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjnath/src/pjnath/stun_session.c b/pjnath/src/pjnath/stun_session.c
index 7586dfc..dbc71ca 100644
--- a/pjnath/src/pjnath/stun_session.c
+++ b/pjnath/src/pjnath/stun_session.c
@@ -843,8 +843,10 @@
     /* Authenticate the message, unless PJ_STUN_NO_AUTHENTICATE
      * is specified in the option.
      */
-    if ((options & PJ_STUN_NO_AUTHENTICATE) == 0) {
-	status = pj_stun_authenticate_response(pkt, pkt_len, msg, &tdata->auth_key);
+    if ((options & PJ_STUN_NO_AUTHENTICATE) == 0 && tdata->auth_key.slen != 0)
+    {
+	status = pj_stun_authenticate_response(pkt, pkt_len, msg, 
+					       &tdata->auth_key);
 	if (status != PJ_SUCCESS) {
 	    PJ_LOG(5,(SNAME(sess), 
 		      "Response authentication failed"));