RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1414568 - MIT Kerberos-generated keytabs are unusable in Java
Summary: MIT Kerberos-generated keytabs are unusable in Java
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: java-1.8.0-ibm
Version: 7.3
Hardware: All
OS: All
unspecified
urgent
Target Milestone: rc
: ---
Assignee: jiri vanek
QA Contact: zzambers
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-18 21:05 UTC by Daniel Sands
Modified: 2021-01-15 07:30 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-01-15 07:30:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Daniel Sands 2017-01-18 21:05:31 UTC
Description of problem:

MIT Kerberos 1.14 seems to have changed the format of their keytab files, as hinted at in the release notes about key version numbers.  Current versions of Java, seemingly all flavors, but first noticed in IBM's and also tested in OpenJDK, cannot read this keytab format.  Attempts to use MIT-generated keytabs fail with strange errors, usually along the lines of null keys or inability to read the file.


Version-Release number of selected component (if applicable):

Tried current latest:  java-1.8.0-ibm-1.8.0.3.20-1jpp.1.el7_2.x86_64

How reproducible:

Always

Steps to Reproduce:
1.  Create a keytab using MIT Kerberos:
$ ktutil
ktutil:  addent -password -p testuser -k 1 -e aes256-cts-hmac-sha1-96
Password for testuser: 
ktutil:  wkt test.keytab
ktutil:  q

2.  Attempt to use the keytab in Java.
$ /usr/lib/jvm/jre-ibm/bin/klist -k -t test.keytab

Key table: test.keytab
Number of entries: 0

$ /usr/lib/jvm/jre-ibm/bin/ktab -l -k test.keytab
The format of key table test.keytab is incorrect.

$ /usr/lib/jvm/jre-ibm/bin/kinit -k -t test.keytab testuser # Assumes testuser is in the database
com.ibm.security.krb5.KrbException, status code: 25
	message: Additional pre-authentication required

Actual results:

Odd error messages

Expected results:

Parsing and use of the keytab file

Additional info:

For verification, I also used Java's ktab program to generate a keytab.  It created a usable keytab file for both Java and MIT Kerberos.

Comment 2 Peter G. Toennies 2017-02-07 23:50:30 UTC
Has anyone else verified this bug? Is there a target date when it might be fixed?

Comment 3 Andrew John Hughes 2017-02-08 00:48:37 UTC
The bug is filed against the IBM JDK, which I believe is provided to Red Hat as a series of binaries. You would thus need to contact IBM to fix the bug there.

We could look at this as an OpenJDK bug if requested.

Comment 4 Daniel Sands 2017-02-08 19:07:07 UTC
Additional testing reveals the following:

OpenJDK 1.8.0.121-0.b13:  Reads the keytab file
Oracle 1.8.0.121-1jpp.1:  Does not read the keytab file
IBM 1.8.0.3.20-1jpp.1:  Does not read the keytab file.

Example program:

import java.io.File;
import javax.security.auth.kerberos.KerberosKey;
import javax.security.auth.kerberos.KerberosPrincipal;
import javax.security.auth.kerberos.KeyTab;

public class keytab {
   public static void main( String[] argv )
   {
      File keytabFile = new File( argv[0] );
      KerberosPrincipal princ = new KerberosPrincipal( argv[1] );
      KeyTab keytab = KeyTab.getInstance( keytabFile );
      for( KerberosKey k : keytab.getKeys( princ ) )
      {
         System.out.println( k.toString() );
      }
   }
}

To run:
java keytab <keytab_file> <principal in file>

On keytabs created in older Kerberos distros, this will output the keys in the keytab.  With keytabs created by current Kerberos in RHEL7, this will output nothing.

Comment 5 Daniel Sands 2017-02-08 20:30:06 UTC
Correction:  I had freshly installed the Oracle version and forgot the unrestricted policy.  After installing the policy, Oracle's Java also read the keytab.  So it appears that IBM Java is the only version that fails to read the keytab (even with their unrestricted policy in place).

Comment 6 Andrew John Hughes 2017-02-09 03:08:21 UTC
Thanks. I was able to read a keytab file generated on RHEL 7's mit-krb5 with the app provided on both java-1.7.0-openjdk and java-1.8.0-openjdk. Looks like an IBM-specific issue.

Comment 10 RHEL Program Management 2021-01-15 07:30:17 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


Note You need to log in before you can comment on or make changes to this bug.