ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] somewhat misleading error messages in -K option processing

From: "Jonathan Schilling" <jschilling@xxxxxxxxxx>
Date: Fri, 19 Feb 2010 10:22:07 -0500
[Resending, since this has not shown up on the archive]

In epan/dissectors/packet-kerberos.c, there is this code in a couple of
places for beginning the -K keytab-file processing:

        /* should use a file in the wireshark users dir */
        ret = krb5_kt_resolve(krb5_ctx, filename, &keytab);
                fprintf(stderr, "KERBEROS ERROR: Could not open keytab file


        ret = krb5_kt_start_seq_get(krb5_ctx, keytab, &cursor);
                fprintf(stderr, "KERBEROS ERROR: Could not read from keytab
file :%s\n",filename);

The two error messages are a bit misleading.  Per the KRB5 API doc at
b5api4.html and elsewhere, krb5_kt_resolve() does *not* try to open the
keytab file, but rather just sees if the name is wrongly formatted.  So the
first message should be "Could not resolve keytab file ..."  If the keytab
filename is wrong, it will be detected in the call to
krb5_kt_start_seq_get().  So the second message should be something like
"Could not open or read from keytab file ...".


Jonathan Schilling