Dear All, 

I am trying to store the PK and signature to sqlite database. I first 
encoded the keys as: 

 pk[node].BEREncode(CryptoPP::StringSink(pkstring).Ref());


and then store them in the database. But as the PK and signature have 
special characteres, they are not stored correctly into the database. what 
I used for storing is: 

*char* * PK = (*char**) *malloc* (BC.trans[l].PK.length()+1);

std::*strcpy*(PK,BC.trans[l].PK.c_str());

*char* *zSQL = *sqlite3_mprintf*("INSERT INTO BC (PK  VALUES ('%q');", PK);

 rc = *sqlite3_exec*(db, zSQL, callback, (*void**)data, &zErrMsg);

free(PK); 


The string should be copied to the char, and the issue happens exactly here 
in copying the content into the char. I think its because the string has 
special characters. For hash I have the same follow but it works perfectly 
fine. Only for PK and signature. I used memcpy and strncpy as well. Nothing 
works for this and still the keys are not stored correctly in the database. 


Any thoughts? 


Regards

Ali 


-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to