Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

klist - Bad format in credentials cache #3

Closed
jerer opened this issue Apr 21, 2019 · 3 comments
Closed

klist - Bad format in credentials cache #3

jerer opened this issue Apr 21, 2019 · 3 comments

Comments

@jerer
Copy link

jerer commented Apr 21, 2019

TGT retreived with sample code cannot be read with klist command (klist returns error "Bad format in credentials cache").

Below is python code to get TGT:

from minikerberos.common import *
from minikerberos.communication import *

ccred = KerberosCredential()
ccred.username = 'administrator'
ccred.domain = 'KB.COM'
ccred.password = 'password'
ksoc = KerberosSocket('krb.kb.com', soc_type = KerberosSocketType.TCP)
kc = KerbrosComm(ccred, ksoc)
kc.get_TGT()
kc.ccache.to_file('/tmp/krb5cc_0')

Below is krb5.conf:

[logging]
 default = FILE:/var/log/krb5libs.log
 kdc = FILE:/var/log/krb5kdc.log
 admin_server = FILE:/var/log/kadmind.log

[libdefaults]
 dns_lookup_realm = false
 ticket_lifetime = 24h
 renew_lifetime = 7d
 forwardable = true
 rdns = false
 pkinit_anchors = /etc/pki/tls/certs/ca-bundle.crt
 default_ccache_name = FILE:/tmp/krb5cc_%{uid}
 default_realm = KB.COM

[realms]
 KB.COM = {
 }

[domain_realm]
 kb.com = KB.COM
 .kb.com = KB.COM
@skelsec
Copy link
Owner

skelsec commented Apr 21, 2019 via email

@skelsec
Copy link
Owner

skelsec commented Apr 22, 2019

Okay, updated a LOT of code just now.
Should fix the issue (basically the bug was in the header-size calculation), the KLIST can parse the file correctly, however if you could verify if it works with the krb5 service and drop me a line I'd apprechiate it!
BTW the examples are all updated as well.

@jerer
Copy link
Author

jerer commented Apr 26, 2019

Yes, now klist works after receiving TGT with minikerberos, other applications using gssapi (ldapsearch, etc) works too. Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants