Hello,
I have been trying to get ykkms (v1.14) and ykval (v2.24) setup, with the objective being to setup free radius and use the PAM interface in the middle. I'm aware of course the yubiradius appliance is available, so this is more of an interest thing rather than anything else!
So I have the KSM working ok, and I also appear to have the validation server working ok too. They are on separate VMs, and both http services (ykksm and ykval) have certificates which are signed by an internal CA.
Where I am getting stuck is, once the ykclient is setup and tested, I can never get it to work, and I believe I am having difficulty troubleshooting it as I am not sure I completely understand the way the HMAC signatures work. With a valid OTP setup in the KSM (that comes back "OK" from the KSM when tested, and "OK" from the ykval) I always get the following error when testing with ykclient
Code:
[root@radius01 ykval]# ykclient --debug --url "https://ykval01. xxxxxxx/verify.php" 1 cccccccccccbkdutgticegguretvnnrddccfcinldjeb
Input:
validation URL: https://ykval01. xxxxxxx/verify.php
client id: 1
token: cccccccccccbkdutgticegguretvnnrddccfcinldjeb
Verification output (104): HMAC signature validation/generation error
[root@ radius01 ~]# echo $?
3
[root@ radius01 ~]#
[root@ radius01 ykval]# ykclient --debug --url "https://ykval01. xxxxxxx/verify.php" 1 cccccccccccbkdutgticegguretvnnrddccfcinldjeb
Input:
validation URL: https://ykval01.xxxxxxx/verify.php
client id: 1
token: cccccccccccbkdutgticegguretvnnrddccfcinldjeb
Verification output (2): Yubikey OTP was replayed (REPLAYED_OTP)
[root@ radius01 ykval]#
by the fact that if the curl test is repeated and then returned a REPLAY, the request to the validation server obviously works! I can see this in the ykval and the ykksam logs.
Additional notes:
- my CA cert is cat'd on to the end of the /etc/pki/tls/certs/ca-bundle, so curl will be picking the CA cert up and this is clear that I have not used the -k option above. I have tried ykclient with the --ca CADIR option, but this didn't make any difference, the docs indicated that if using https with a valid CA, api keys shouldn't necessarily be needed?
- I have tried using an API key in the clients table on the ykval server, and using --apikey KEY, but this doesn't work either even when using the same key. Currently this field in the table for client "1" is empty.
I have tried using the same ykclient to api.yubico.com using a registered apikey and a registered yubikey OTP and this does work, so do I have a problem with the configuration of ykval, and issue with the way ykval is processing HMAC, or some issue with the "client" configuration for client "1"?
I've been struggling to get a solution to this, so any help would be gratefully appreciated!
Many thanks in advance