Yubico Forum

...visit our web-store at store.yubico.com
It is currently Tue Jan 30, 2018 3:01 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Oct 20, 2009 3:03 pm 
Offline

Joined: Tue Oct 20, 2009 2:49 pm
Posts: 2
Hi.

First of all I would like to clarify my vision:

I want to host my own validation server. I have MSSQL 05 Db, and php 5.2.x
. I have downloaded and successfully implemented ksm. And now I am trying to run my validation server and I am failing all the time. The most recent issue is that in function
Code:
getAuthData($conn, $devId) {
   $publicName = modhex2b64($devId);
   $stmt =
     'SELECT id, active, counter, sessionUse, low, high, accessed '.
     'FROM ksm_yubikeys '.
     'WHERE publicName='.mssql_quote($publicName);
   $r = query($conn, $stmt);
   if (mssql_num_rows($r) > 0) {
      $row = mssql_fetch_array($r);
      mssql_free_result($r);
      return $row;
   }
   return null;
}

I get errors about invalid columns names 'counter' 'sessionUse' 'low' 'high' 'accessed'. And I know it is true, because my ksm_yubikeys table looks like this: [id] ,[serialNr] ,[publicName] ,[created] ,[internalName],[aesKey] ,[lockCode] ,[creator] ,[active] ,[hardware]. I though about creating a new table, but in this forum thread viewtopic.php?f=5&t=393 there is nothing about any additional data tables.
Thanks for any clues.


Top
 Profile  
Reply with quote  

Share On:

Share on Facebook FacebookShare on Twitter TwitterShare on Tumblr TumblrShare on Google+ Google+

PostPosted: Fri Oct 23, 2009 10:31 am 
Offline
Yubico Team
Yubico Team

Joined: Wed Oct 01, 2008 8:11 am
Posts: 210
It seems that you have modified the code. The actual code of the getAuthData function is as follows:

Code:
function getAuthData($conn, $devId) {
        $publicName = modhex2b64($devId);
        $stmt =
          'SELECT id, active, counter, sessionUse, low, high, accessed '.
          'FROM yubikeys '.
          'WHERE publicName='.mysql_quote($publicName);
        $r = query($conn, $stmt);
        if (mysql_num_rows($r) > 0) {
                $row = mysql_fetch_assoc($r);
                mysql_free_result($r);
                return $row;
        }
        return null;
} // End getAuthData


Here the "yubikeys" table used must be from the table from the YK_VAL database and not from the YK_KSM database.

We would appreciate if you can check the database settings in the "ykval-config.php". If they are pointing to YK_KSM database, please change them to point to YK_VAL database and update the code of "getAuthData" function to use the "yubikeys" table of the YK_VAL database.

We hope this helps!


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 23, 2009 2:14 pm 
Offline

Joined: Tue Oct 20, 2009 2:49 pm
Posts: 2
Well yes I did modify the code, while I am trying to run validation server on mssql05. Ok. So as I understand I need two dbs, one for validation server with - like ykval-db.sql, and the other for ksm - like ykksm-db.sql, don't I? And if I want YMS I need to have another one, right? I am asking, because I am a little bit confused. Now I have a working validation. If you would like to check it I can send you an address and a sample yubikey settings.

And while I am here, I would like to ask you about this part of getAuthData:

$publicName = modhex2b64($devId);

is it normal that $devId has a value of plain public part of otp retrieved from db? I mean it looks like vvsthsthsth?
and than after modhex2b64() it is send to db as a decrypted text?

Because firstly I get client data from ksm_clients table in ksm-db, and than I am saving used otp into yubikeys table of ykval-db. I hope you understand what I am trying to say. If not I will write a longer post.

Thanks for reply.


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 23, 2009 3:14 pm 
Offline
Yubico Team
Yubico Team

Joined: Wed Oct 01, 2008 8:11 am
Posts: 210
We can use a combine database for both YMS and YK_VAL. Please use the step by step YMS server installation guide available at the following link:

viewtopic.php?f=5&t=315&p=1418#p1418


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group