<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="https://forum.yubico.com/feed.php?f=5&amp;t=2285" />

<title>Yubico Forum</title>
<subtitle>...visit our web-store at</subtitle>
<link href="https://forum.yubico.com/index.php" />
<updated>2016-05-03T17:50:42+01:00</updated>

<author><name><![CDATA[Yubico Forum]]></name></author>
<id>https://forum.yubico.com/feed.php?f=5&amp;t=2285</id>
<entry>
<author><name><![CDATA[JanMichaelVincent]]></name></author>
<updated>2016-05-03T17:50:42+01:00</updated>
<published>2016-05-03T17:50:42+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=2285&amp;p=8595#p8595</id>
<link href="https://forum.yubico.com/viewtopic.php?t=2285&amp;p=8595#p8595"/>
<title type="html"><![CDATA[Re: YK-val sync works only one way. Can someone help?]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=2285&amp;p=8595#p8595"><![CDATA[
Just to close the loop, new git version of synclib fixes this issue.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=4290">JanMichaelVincent</a> — Tue May 03, 2016 5:50 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[JanMichaelVincent]]></name></author>
<updated>2016-04-22T23:59:20+01:00</updated>
<published>2016-04-22T23:59:20+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=2285&amp;p=8568#p8568</id>
<link href="https://forum.yubico.com/viewtopic.php?t=2285&amp;p=8568#p8568"/>
<title type="html"><![CDATA[Re: YK-val sync works only one way. Can someone help?]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=2285&amp;p=8568#p8568"><![CDATA[
I am on CentOS 6 using latest yubikey-val from git. <br />As long as queue table is empty no errors. As soon as entry appears there I get errors. Here's mysql debug log on second-yk-server.local: <br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">160422 15:57:36       3 Query   select distinct server from queue WHERE queued &lt; 1461365846 or queued is null<br />          3 Query   select * from queue WHERE (queued &lt; 1461365846 or queued is null) and server='http://first-yk-server.local/wsapi/2.0/sync' LIMIT 1000<br />          3 Query   UPDATE yubikeys SET  modified='1461363170', yk_counter='313', yk_use='0', yk_low='17484', yk_high='90', nonce='&lt;&lt;NONCE&gt;&gt;' WHERE yk_publicname = 'cccccc&lt;&lt;6CHARS&gt;&gt;' and (313&gt;yk_counter or (313=yk_counter and 0&gt;yk_use))<br />          3 Query   SELECT * FROM yubikeys WHERE yk_publicname is NULL LIMIT 1<br />          3 Query   INSERT INTO yubikeys (active,created,modified,yk_counter,yk_use,yk_low,yk_high,nonce,notes) VALUES ('1','1461365856','-1','-1','-1','-1','-1','0000000000000000','')<br />          3 Query   SELECT * FROM yubikeys WHERE yk_publicname is NULL LIMIT 1<br />          3 Query   DELETE FROM queue WHERE modified = '' and server_nonce = '' and server = ''</div><br /><br />And these are coming in every second even if bogus entry is there. Any workaround for CentOS and git?<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=4290">JanMichaelVincent</a> — Fri Apr 22, 2016 11:59 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Tom2]]></name></author>
<updated>2016-04-22T12:20:12+01:00</updated>
<published>2016-04-22T12:20:12+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=2285&amp;p=8566#p8566</id>
<link href="https://forum.yubico.com/viewtopic.php?t=2285&amp;p=8566#p8566"/>
<title type="html"><![CDATA[Re: YK-val sync works only one way. Can someone help?]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=2285&amp;p=8566#p8566"><![CDATA[
Ideally you should use our yubikey-val package, on ubuntu 14.04 preferably.<br /><br />I think that should solve you issue.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=3364">Tom2</a> — Fri Apr 22, 2016 12:20 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[JanMichaelVincent]]></name></author>
<updated>2016-04-19T19:01:55+01:00</updated>
<published>2016-04-19T19:01:55+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=2285&amp;p=8558#p8558</id>
<link href="https://forum.yubico.com/viewtopic.php?t=2285&amp;p=8558#p8558"/>
<title type="html"><![CDATA[YK-val sync works only one way. Can someone help?]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=2285&amp;p=8558#p8558"><![CDATA[
Hi all, <br />I am trying to set up a cluster for yubikey OTP validation using radius. I followed this: <!-- m --><a class="postlink" href="https://developers.yubico.com/yubikey-val/Installation.html">https://developers.yubico.com/yubikey-v ... ation.html</a><!-- m --><br /><br />Now, I have two servers with two YubiHSMs which are in the same pool. Here is my ykval-config.php on both: <br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">&lt;?php<br />$baseParams = array ();<br />$baseParams&#91;'__YKVAL_DB_DSN__'&#93; = &quot;mysql:dbname=ykval;host=127.0.0.1&quot;;<br />$baseParams&#91;'__YKVAL_DB_USER__'&#93; = 'ykval_verifier';<br />$baseParams&#91;'__YKVAL_DB_PW__'&#93; = 'Pa$$W0RD';<br />$baseParams&#91;'__YKVAL_DB_OPTIONS__'&#93; = array();<br /><br />$baseParams&#91;'__YKRESYNC_IPS__'&#93; = array(&quot;192.168.1.12&quot;, &quot;192.168.1.20&quot;);<br />$baseParams&#91;'__YKVAL_SYNC_POOL__'&#93; = array(&quot;http://first-yk-server.local/wsapi/2.0/sync&quot;, &quot;http://second-yk-server.local/wsapi/2.0/sync&quot;);<br /><br />$baseParams&#91;'__YKVAL_ALLOWED_SYNC_POOL__'&#93; = array(&quot;192.168.1.12&quot;, &quot;192.168.1.20&quot;);<br /><br />$baseParams&#91;'__YKVAL_SYNC_INTERVAL__'&#93; = 10;<br />$baseParams&#91;'__YKVAL_SYNC_RESYNC_TIMEOUT__'&#93; = 30;<br />$baseParams&#91;'__YKVAL_SYNC_OLD_LIMIT__'&#93; = 10;<br /><br />$baseParams&#91;'__YKVAL_SYNC_FAST_LEVEL__'&#93; = 1;<br />$baseParams&#91;'__YKVAL_SYNC_SECURE_LEVEL__'&#93; = 40;<br />$baseParams&#91;'__YKVAL_SYNC_DEFAULT_LEVEL__'&#93; = 30;<br />$baseParams&#91;'__YKVAL_SYNC_DEFAULT_TIMEOUT__'&#93; = 1;<br /><br />function otp2ksmurls ($otp, $client) {<br /><br />  return array(<br />               &quot;http://127.0.0.1:8002/wsapi/decrypt?otp=$otp&quot;,<br />               );<br />}<br /><br />?&gt;</div><br /><br />This is what happens if I fire up ykval-queue: <br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent"># ykval-queue<br />PHP Notice:  Undefined index:  in /usr/share/yubikey-val/ykval-synclib.php on line 332<br />PHP Notice:  Undefined offset: 1 in /usr/share/yubikey-val/ykval-synclib.php on line 589<br />PHP Notice:  Undefined index: local_counter in /usr/share/yubikey-val/ykval-synclib.php on line 592<br />PHP Notice:  Undefined index: local_use in /usr/share/yubikey-val/ykval-synclib.php on line 593<br />PHP Notice:  Undefined index: yk_publicname in /usr/share/yubikey-val/ykval-synclib.php on line 355<br />PHP Notice:  Undefined index: modified in /usr/share/yubikey-val/ykval-synclib.php on line 156<br />PHP Notice:  Undefined index: nonce in /usr/share/yubikey-val/ykval-synclib.php on line 157<br />PHP Notice:  Undefined index: yk_publicname in /usr/share/yubikey-val/ykval-synclib.php on line 158<br />PHP Notice:  Undefined index: yk_high in /usr/share/yubikey-val/ykval-synclib.php on line 161<br />PHP Notice:  Undefined index: yk_low in /usr/share/yubikey-val/ykval-synclib.php on line 162<br />PHP Notice:  Undefined index: yk_counter in /usr/share/yubikey-val/ykval-synclib.php on line 271<br />PHP Notice:  Undefined index: yk_counter in /usr/share/yubikey-val/ykval-synclib.php on line 249<br />PHP Notice:  Undefined index:  in /usr/share/yubikey-val/ykval-synclib.php on line 424</div><br /><br />And this: <br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">PHP Notice:  Undefined index: �U� in /usr/share/yubikey-val/ykval-synclib.php on line 332<br />PHP Notice:  Undefined offset: 1 in /usr/share/yubikey-val/ykval-synclib.php on line 589<br />PHP Notice:  Undefined index: local_counter in /usr/share/yubikey-val/ykval-synclib.php on line 592<br />PHP Notice:  Undefined index: local_use in /usr/share/yubikey-val/ykval-synclib.php on line 593<br />PHP Notice:  Undefined index: yk_publicname in /usr/share/yubikey-val/ykval-synclib.php on line 355<br />PHP Notice:  Undefined index: modified in /usr/share/yubikey-val/ykval-synclib.php on line 156<br />PHP Notice:  Undefined index: nonce in /usr/share/yubikey-val/ykval-synclib.php on line 157<br />PHP Notice:  Undefined index: yk_publicname in /usr/share/yubikey-val/ykval-synclib.php on line 158<br />PHP Notice:  Undefined index: yk_high in /usr/share/yubikey-val/ykval-synclib.php on line 161<br />PHP Notice:  Undefined index: yk_low in /usr/share/yubikey-val/ykval-synclib.php on line 162<br />PHP Notice:  Undefined index: yk_counter in /usr/share/yubikey-val/ykval-synclib.php on line 271<br />PHP Notice:  Undefined index: yk_counter in /usr/share/yubikey-val/ykval-synclib.php on line 249<br />PHP Notice:  Undefined index: �U� in /usr/share/yubikey-val/ykval-synclib.php on line 424<br />PHP Warning:  curl_close() expects parameter 1 to be resource, array given in /usr/share/yubikey-val/ykval-synclib.php on line 447</div><br /><br />Some strange unicode characters are appearing here. <br /><br />And I noticed bogus entry in db which is probably causing all this: <br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">mysql&gt; SELECT * from yubikeys WHERE yk_publicname = &quot;&quot;;<br />+--------+------------+----------+---------------+------------+--------+--------+---------+------------------+-------+<br />| active | created    | modified | yk_publicname | yk_counter | yk_use | yk_low | yk_high | nonce            | notes |<br />+--------+------------+----------+---------------+------------+--------+--------+---------+------------------+-------+<br />|      1 | 1461087547 |       -1 |               |         -1 |     -1 |     -1 |      -1 | 0000000000000000 |       |<br />+--------+------------+----------+---------------+------------+--------+--------+---------+------------------+-------+<br />1 row in set (0.00 sec)</div><br /><br />I can delete it but it comes back as long as ykval-queue is running. <br /><br />Finally here is my /var/log/messages on the host that has problems (second.yk-server.local in my config):<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">LOG_INFO:ykval-queue:synclib:server=http://first-yk-server.local/wsapi/2.0/sync, server_nonce=&lt;SERVER_NONCE_HERE&gt;, info=yk_publicname=cccccc&lt;6morechars&gt;&amp;yk_counter=50&amp;yk_use=0&amp;yk_high=169&amp;yk_low=788&amp;nonce=&lt;NONCE_HERE&gt;,local_counter=49&amp;local_use=0<br />LOG_INFO:ykval-queue:synclib:database not updated modified=1461087576 nonce=&lt;NONCE_HERE&gt; yk_publicname=cccccc&lt;6morechars&gt; yk_counter=52 yk_use=0 yk_high=188 yk_low=11100<br />LOG_NOTICE:ykval-queue:synclib:Discovered new identity<br />LOG_NOTICE:ykval-queue:synclib:params for yk_publicname  not found in database<br />LOG_NOTICE:ykval-queue:synclib:Local server out of sync compared to counters at validation request time.<br />LOG_WARNING:ykval-queue:synclib:Local server out of sync compared to current local counters. Local server updated.<br />LOG_ERR:ykval-queue:synclib:Remote server has higher counters than OTP. This response would have marked the OTP as invalid.</div><br /><br />I had to censor my nonce/yk_publicname.. <br /><br />Anyway does anyone know what is causing this and what can I do to debug this more? <br /><br />I tried dropping yubikeys and queue tables but same problem starts to appear again. Here is my queue table on second server: <br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">mysql&gt; select * from queue;<br />+--------+------------+----------------------------------+----------------------------------------------+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+<br />| queued | modified   | server_nonce                     | otp                                          | server                                | info                                                                                                                                                 |<br />+--------+------------+----------------------------------+----------------------------------------------+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+<br />|   NULL | 1461087545 | 7e259894650a75f053b41df688c674ad | cccccc&lt;THE_REST_OF_OTP&gt; | http://first-yk-server.local/wsapi/2.0/sync | yk_publicname=cccccc&lt;6morechars&gt;&amp;yk_counter=50&amp;yk_use=0&amp;yk_high=169&amp;yk_low=788&amp;nonce=&lt;NONCE&gt;,local_counter=49&amp;local_use=0   |<br />|   NULL | 1461087571 | 37b4701d86ef6c66d5e0ff6ad6288a13 | cccccc&lt;THE_REST_OF_OTP&gt; | http://first-yk-server.local/wsapi/2.0/sync | yk_publicname=cccccc&lt;6morechars&gt;&amp;yk_counter=52&amp;yk_use=0&amp;yk_high=188&amp;yk_low=11100&amp;nonce=&lt;NONCE&gt;,local_counter=51&amp;local_use=0 |<br />+--------+------------+----------------------------------+----------------------------------------------+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+<br />2 rows in set (0.00 sec)</div><p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=4290">JanMichaelVincent</a> — Tue Apr 19, 2016 7:01 pm</p><hr />
]]></content>
</entry>
</feed>