shishi-commit
[Top][All Lists]
Advanced

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

CVS shishi/lib


From: shishi-commit
Subject: CVS shishi/lib
Date: Thu, 30 Mar 2006 15:28:25 +0200

Update of /home/jas/self/public-cvs/shishi/lib
In directory latte:/home/jas/self/src/shishi/lib

Modified Files:
        krberror.c 
Log Message:
Print which pre-auth types were requested by server.


--- /home/jas/self/public-cvs/shishi/lib/krberror.c     2006/03/23 09:53:04     
1.52
+++ /home/jas/self/public-cvs/shishi/lib/krberror.c     2006/03/30 13:28:17     
1.53
@@ -1157,6 +1157,60 @@
          buf[len] = '\0';
          fprintf (fh, "Additional error message from server:\n%s\n", buf);
        }
+      free (buf);
+
+      if (shishi_krberror_errorcode_fast (handle, krberror) ==
+         SHISHI_KDC_ERR_PREAUTH_REQUIRED)
+       {
+         Shishi_asn1 pas;
+         size_t i, n;
+
+         res = shishi_krberror_edata (handle, krberror, &buf, &len);
+         if (res != SHISHI_OK)
+           {
+             fprintf (fh, "Could not extract METHOD-DATA:\n%s\n",
+                      shishi_strerror (res));
+             return SHISHI_OK;
+           }
+
+         pas = shishi_der2asn1_methoddata (handle, buf, len);
+         free (buf);
+         if (!pas)
+           {
+             fprintf (fh, "Could not decode METHOD-DATA:\n%s\n",
+                      shishi_strerror (res));
+             return SHISHI_OK;
+           }
+
+         if (VERBOSEASN1 (handle))
+           shishi_methoddata_print (handle, stdout, pas);
+
+         res = shishi_asn1_number_of_elements (handle, pas, "", &n);
+         if (res == SHISHI_OK)
+           {
+             fprintf (fh, "Types of PA-DATA requested: ");
+
+             for (i = 1; i <= n; i++)
+               {
+                 char *format = xasprintf ("?%d.padata-type", i);
+                 int32_t padatatype;
+
+                 if (i > 1)
+                   fprintf (fh, ", ");
+
+                 res = shishi_asn1_read_int32 (handle, pas, format,
+                                               &padatatype);
+                 if (res == SHISHI_OK)
+                   printf ("%d", padatatype);
+
+                 free (format);
+               }
+
+             fprintf (fh, ".\n");
+           }
+
+         shishi_asn1_done (handle, pas);
+       }
     }
 
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]