$OpenBSD: patch-src_ka-dialog_c,v 1.1 2010/06/30 00:15:03 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 Jun 18 20:53:50 2010
+++ src/ka-dialog.c	Wed Jun 30 01:52:34 2010
@@ -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>
@@ -165,8 +166,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"));
@@ -585,8 +584,6 @@ ka_auth_heimdal_pkinit(KaApplet* applet, krb5_creds* c
 						    kprincipal,
 						    pk_userid,
 						    pkinit_anchors,
-						    NULL,
-						    NULL,
 						    0,	  /* pk_use_enc_key */
 						    auth_dialog_prompter,
 						    applet, /* data */
@@ -600,7 +597,7 @@ ka_auth_heimdal_pkinit(KaApplet* applet, krb5_creds* c
 		                              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 */
@@ -622,7 +619,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;
 }
 
