I want to use the CMP functions and try to set the CRYPT_KEYSET_ODBC_STORE.
The OS is Linux debian 2.6.26-1-vserver-amd64
The ODBC library is /usr/lib/odbc/libmyodbc.so (3.51.15r409-4)
ODBC driver :
[MySQL]
Description = MySQL driver
Driver = /usr/lib/odbc/libmyodbc.so
Setup = /usr/lib/odbc/libodbcmyS.so
CPTimeout =
CPReuse =
CA data source :
[CA_DB]
Driver = MySQL
Description = MySQL ODBC 3.51 DB CA
server = 192.168.0.192
Port = 3306
User = root
Password = xxxxxx
Database = ca
Option = 3
Socket =
The database server is on a virtuel server (vserver). OS : Linux Debian
2.6.18-6-686
Database server MySQL 5.0.32-Debian_7Etch8-log
I've configured the cryptlib makefile in line 62 to include the ODBC flag :
CFLAGS = "-c -D__UNIX__ -DNDEBUG -DUSE_ODBC -I."
and line 67 to link testlib with libodbc :
TESTLIB = -lodbc
testlib reports :
Testing certificate database write...
Handling for certificate databases doesn't appear to be enabled in this
build of cryptlib, skipping the test of the certificate database routines.
and :
The certificate database wasn't updated with dual encryption/signing certs
during this test run (either because database keysets aren't enabled in
this
build of cryptlib or because only some portions of the self-tests are being
run), skipping the test of CMS enveloping with dual certs.
So i write my own test program and i get an error when i want to open
the keyset :
status = cryptKeysetOpen( &cryptCertStore, CRYPT_UNUSED,
CRYPT_KEYSET_ODBC_STORE, "CA_DB", CRYPT_KEYOPT_CREATE );
I investigate the keyset/odbc.c file and i see that during the call to
performUpdate for creating the tables, the request is rewrited
incorrectly :
CREATE TABLE certificates (C CHAR(2), SP VARCHAR(64), L VARCHAR(64), O
VARCHAR(64), OU VARCHAR(64), CN VARCHAR(64), email VARCHAR(64), validTo
DATETIME NOT NULL, nameID CHAR(22) NOT NULL, issuerID CHAR(22) NOT NULL,
keyID CHAR(22) NOT NULL, certID CHAR(22) NOT NULL, certData BLOB NOT NULL)
is transformed in
CREATE TABLE certificates (C CHAR(2), SP VARCHAR(64), L VARCHAR(64), O
VARCHAR(64), OU VARCHAR(64), CN VARCHAR(64), email VARCHAR(64), validTo
NOT NULL, nameID CHAR(22) NOT NULL, issuerID CHAR(22) NOT NULL, keyID
CHAR(22) NOT NULL, certID CHAR(22) NOT NULL, certData NOT NULL)
The DATETIME and BLOB type aren't rewrited.
In the getBlobInfo and getDateTimeInfo functions, the odbc call to
SQLGetData don't report the data length.
I correct the returned length whith the strlen(data) and the
performUpdate succed. The request is rewrited as :
CREATE TABLE certificates (C CHAR(2), SP VARCHAR(64), L VARCHAR(64), O
VARCHAR(64), OU VARCHAR(64), CN VARCHAR(64), email VARCHAR(64), validTo
DATETIME NOT NULL, nameID CHAR(22) NOT NULL, issuerID CHAR(22) NOT NULL,
keyID CHAR(22) NOT NULL, certID CHAR(22) NOT NULL, certData long
varbinary NOT NULL)
Bur now, it's the performUpdate for inserting data that fail (the call
to bindParameters succed).
Can you help me, please.
Pierre Guerin
_______________________________________________
Cryptlib mailing list
Cryptlib@... via Mail:
cryptlib-request@...
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlibPosts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.