jcmturner / gokrb5

Pure Go Kerberos library for clients and services
Apache License 2.0
723 stars 245 forks source link

[v8] KVNO 0 seems to be hard-coded for clients #446

Open aitorpazos opened 3 years ago

aitorpazos commented 3 years ago

Summary

Trying to integrate Vault with FreeIPA I hit the issue with the vault client trying to get the keytab secret from kvno 0, but FreeIPA generates the keytab starting on kvno 1.

Steps to reproduce

$ klist -k test-svc.keytab 
Keytab name: FILE:test-svc.keytab
KVNO Principal
---- --------------------------------------------------------------------------
   1 test-svc/host1.example.com@EXAMPLE.COM

Looking at the code I found the kvno value hardcoded to 0 in v8/client/ASExchange.go, which is the code used by vault client.

Otherwise the file looks good:

$ kvno -k test-svc.keytab test-svc/host1.example.com
test-svc/host1.example.com@EXAMPLE.COM: kvno = 1, keytab entry valid