Pull EOF fix to this branch, workaround Globus problem by clearing
authorZdeněk Salvet <salvet@ics.muni.cz>
Wed, 22 Aug 2007 11:13:48 +0000 (11:13 +0000)
committerZdeněk Salvet <salvet@ics.muni.cz>
Wed, 22 Aug 2007 11:13:48 +0000 (11:13 +0000)
SSL error stack before gss_unwrap() call.

org.glite.security.gsoap-plugin/interface/glite_gss.h
org.glite.security.gsoap-plugin/src/glite_gss.c

index 3dd4903..fd1739a 100644 (file)
@@ -4,6 +4,7 @@
 #ident "$Header$"
 
 #include <gssapi.h>
+#include <openssl/err.h>
 
 #ifdef __cplusplus
 extern "C" {
index 1bf7fd3..d158ff3 100644 (file)
@@ -366,8 +366,12 @@ recv_token(int sock, void **token, size_t *token_length, struct timeval *to)
            goto end;
         }
       }
-      if (count == 0 && tl == 0 && errno == 0)
-        return EDG_WLL_GSS_ERROR_EOF; 
+
+      if (count==0) {
+         if (tl==0) 
+            return EDG_WLL_GSS_ERROR_EOF;
+         else goto end;
+      }
       tmp=realloc(t, tl + count);
       if (tmp == NULL) {
         errno = ENOMEM;
@@ -867,6 +871,7 @@ edg_wll_gss_read(edg_wll_GssConnection *connection, void *buf, size_t bufsize,
         /* XXX cleanup */
         return ret;
 
+      ERR_clear_error();
       maj_stat = gss_unwrap(&min_stat, connection->context, &input_token,
                            &output_token, NULL, NULL);
       gss_release_buffer(&min_stat, &input_token);