$OpenBSD: patch-src_ka-dialog_c,v 1.1.1.1 2011/07/15 08:28:20 ajacoutot Exp $

XXX these should be handled by configure checks.
  krb5_get_init_creds_opt_set_pkinit: does not take 11 arguments.
  krb5_get_init_creds_opt_free: the context argument is an MIT extension.

--- src/ka-dialog.c.orig	Fri Apr 22 21:15:57 2011
+++ src/ka-dialog.c	Fri Jul 15 09:29:25 2011
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 #include <time.h>
 #include <krb5.h>
+#include <com_err.h>
 #include <stdio.h>
 #include <sys/wait.h>
 #include <string.h>
@@ -170,8 +171,6 @@ ka_get_error_message (krb5_context context, krb5_error
     krberr = krb5_get_error_message (context, err);
     msg = g_strdup (krberr);
     ka_krb5_free_error_message (context, krberr);
-#else
-#	error No detailed error message information
 #endif
     if (msg == NULL)
         msg = g_strdup (_("unknown error"));
@@ -595,7 +594,7 @@ ka_auth_heimdal_pkinit (KaApplet *applet, krb5_creds *
         goto out;
 
     ka_set_ticket_options (applet, kcontext, opts, NULL, NULL);
-    retval = krb5_get_init_creds_opt_set_pkinit (kcontext, opts, kprincipal, pk_userid, pkinit_anchors, NULL, NULL, 0,  /* pk_use_enc_key */
+    retval = krb5_get_init_creds_opt_set_pkinit (kcontext, opts, kprincipal, pk_userid, pkinit_anchors, 0,  /* pk_use_enc_key */
                                                  auth_dialog_prompter, applet,  /* data */
                                                  NULL); /* passwd */
     KA_DEBUG ("pkinit returned with %d", retval);
@@ -607,7 +606,7 @@ ka_auth_heimdal_pkinit (KaApplet *applet, krb5_creds *
                                            0, NULL, opts);
   out:
     if (opts)
-        krb5_get_init_creds_opt_free (kcontext, opts);
+        krb5_get_init_creds_opt_free (opts);
     return retval;
 }
 #endif /* ! ENABLE_PKINIT */
@@ -628,7 +627,7 @@ ka_auth_password (KaApplet *applet, krb5_creds *creds,
                                            0, NULL, opts);
   out:
     if (opts)
-        krb5_get_init_creds_opt_free (kcontext, opts);
+        krb5_get_init_creds_opt_free (opts);
     return retval;
 }
 
