EVP_get_digestbynid() and ENGINE_get_digest()

2014-01-26 Thread cellecial
Hi, We had a product which generate RSA/MD5 certificate. Now I'm working on a custom openssl engine. The goal is to generate X509 certificate with some new signature/digest algorithms. With engine, we do not need to re-code too much. Now we can generate and sign certificate, but X509_verify()

[no subject]

2014-01-26 Thread cellecial
Hi, We had a product which generate RSA/MD5 certificate. Now I'm working on a custom openssl engine. The goal is to generate X509 certificate with some new signature/digest algorithms. With engine, we do not need to re-code too much. Now we can generate and sign certificate, but X509_verify()

i2d_ASN1_BIT_STRING() and 0x00-terminated string

2013-10-29 Thread cellecial
Hi, I have a problem with i2d_ASN1_BIT_STRING(). If I set data with a 0x00-terminated string , i2d_ASN1_BIT_STRING() will trim off 0x00. Here is a sample code: -- #include stdio.h #include openssl/asn1.h int main() { unsigned char *buf = NULL,*temp_buf =

Re: i2d_ASN1_BIT_STRING() and 0x00-terminated string

2013-10-29 Thread cellecial
Thank you, I rewrite the code ,but 0x00 is still trimmed off. int main() { unsigned char *buf = NULL,*temp_buf = NULL; int buflen = 128; ASN1_BIT_STRING *bs = NULL,*bs2 = NULL; int i = 0,j = 0; int ret = 0; int derlen = 0; unsigned char *p = NULL; buf = OPENSSL_malloc(150); temp_buf =

Re: EVP_get_digestbynid() return NULL

2013-03-13 Thread cellecial
but I tried md = EVP_get_digestbynid(NID_md5), still NULL On Thu, Mar 14, 2013 at 11:54 AM, Viktor Dukhovni openssl-us...@dukhovni.org wrote: On Thu, Mar 14, 2013 at 11:34:12AM +0800, cellecial wrote: I'm frustrated that I can't get correct result from such a simple API(on openssl

Re: How to separate ECC Public Key from keypairs and convert it to EVP_PKEY?

2013-01-31 Thread cellecial
On Wed, Jan 30, 2013 at 9:51 PM, Dr. Stephen Henson st...@openssl.orgwrote: If you want it to just use the curve name instead you have to call: EC_KEY_set_asn1_flag(eckey, OPENSSL_EC_NAMED_CURVE); Steve. -- It's efficacious. After I call EC_KEY_set_asn1_flag() before

PKCS12_parse() in multi-threads, heap is corrupt

2011-12-11 Thread cellecial
Hi, I wrote a simple pkcs12 demo(under Windows), it just read from a PKCS12 file and got private key and certificate. If I use single thread, it works fine. If I use multi-thread, it works fine for a while ,then popups an error dialogue heap is corrupt.If I debug it in Visual

Re: PKCS12_parse() in multi-threads, heap is corrupt

2011-12-11 Thread cellecial
, cellecial wrote: Hi, I wrote a simple pkcs12 demo(under Windows), it just read from a PKCS12 file and got private key and certificate. If I use single thread, it works fine. If I use multi-thread, it works fine for a while ,then popups an error dialogue heap is corrupt.If I

Re: PKCS12_parse() in multi-threads, heap is corrupt

2011-12-11 Thread cellecial
it work? On Sun, Dec 11, 2011 at 8:51 PM, Dr. Stephen Henson st...@openssl.orgwrote: On Sun, Dec 11, 2011, cellecial wrote: Thank you. I add OpenSSL_add_all_algorithms(); in main function and include openssl/evp.h,but it still pops error dialogue after a while. Some threads can end well, others

using openssl and sunjce, encrypt same text,get different result

2005-06-09 Thread cellecial
Hi, I need to encrypt data using C+openssl,then decrypt data using JAVA+SUNJCE. When I encrypt the same plaintext using openssl and sunjce, I found the two ciphertexts are different. I tried two algorithms:EVP_des_ede() / DES ,EVP_rc4() / RC4, but the results are all depressing. I googled a post