Yubico Forum
https://forum.yubico.com/

[QUESTION] troubleshooting ykclient to ykval
https://forum.yubico.com/viewtopic.php?f=3&t=1239
Page 1 of 1

Author:  krisl [ Sat Nov 23, 2013 12:31 pm ]
Post subject:  [QUESTION] troubleshooting ykclient to ykval

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 :)

Author:  krisl [ Mon Nov 25, 2013 9:31 pm ]
Post subject:  Re: [QUESTION] troubleshooting ykclient to ykval

Hi krisl (yes I'm replying to my own post).

well.. I did some debugging, and the issue I was coming up against was that I was being lazy with the api root directory structure. I had /var/www/ykval as my root with /var/www/ykval/verify.php being symlinked to the one in /usr/share. Its important to note that the /wsapi/2.0 directory should be here too! as the verify script tries to parse the API version from the request This is in the instructions, my brain chose to ignore it.

Setting the directory up correctly resulted in it all working, so I can crack on with PAM now.

krisl

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/