Re: Openssl backward compatibility

2007-09-28 Thread Kaushalye Kapuruge
Dr. Stephen Henson wrote: On Fri, Sep 28, 2007, jimmy bahuleyan wrote: Kaushalye Kapuruge wrote: Hi Listers, I'm having a problem shipping my (xml security)library, which is based on openssl crypto implementation. I have statically linked it with the ssl and crypto libraries (-lssl

Re: Openssl backward compatibility

2007-09-28 Thread Kaushalye Kapuruge
jimmy bahuleyan wrote: Kaushalye Kapuruge wrote: Hi Listers, I'm having a problem shipping my (xml security)library, which is based on openssl crypto implementation. I have statically linked it with the ssl and crypto libraries (-lssl -lcrypto). Are you sure you have statically linked

Openssl backward compatibility

2007-09-27 Thread Kaushalye Kapuruge
Hi Listers, I'm having a problem shipping my (xml security)library, which is based on openssl crypto implementation. I have statically linked it with the ssl and crypto libraries (-lssl -lcrypto). And my openssl version is OpenSSL 0.9.8c 05 Sep 2006 (Library: OpenSSL 0.9.8e 23 Feb 2007) When

Re: Memeory leak in PEM_read_bio_X509

2007-08-21 Thread Kaushalye Kapuruge
Hi, Somebody please reply to my question... :) Cheers, Kaushalye Kaushalye Kapuruge wrote: Hi, I found that there is a memory leak in the function PEM_read_bio_X509(); Herewith I've attached the valgrind trace(with flags --tool=memcheck --leak-check=full --show-reachable=yes ) and a sample

Re: Memeory leak in PEM_read_bio_X509

2007-08-21 Thread Kaushalye Kapuruge
Yeah thanks.. It's my bad to miss such a simple thingy... The problem was actually my program(more complex than the test case) is giving the same memory leak. Seems I have to look at my code more carefully. Cheers, Kaushalye Nick Hudson wrote: Kaushalye Kapuruge wrote: Hi, Somebody please

Memeory leak in PEM_read_bio_X509

2007-08-15 Thread Kaushalye Kapuruge
Hi, I found that there is a memory leak in the function PEM_read_bio_X509(); Herewith I've attached the valgrind trace(with flags --tool=memcheck --leak-check=full --show-reachable=yes ) and a sample test case. Is this a known issue or have I missed some steps? Cheers, Kaushalye --

Re: 0.9.8.e build for Windows

2007-05-07 Thread Kaushalye Kapuruge
Hi, Check here... :) http://www.slproweb.com/products/Win32OpenSSL.html Cheers, Kaushalye janbar1 wrote: Hi, all :) It's my first post here and first newbie question ;] Where can I downlad 0.9.8.e build for Windows? I'm not a programmer and can't build it myself and like I was reading here it's

Re: Problem with EVP_Decode and line breaks in a X509 certificate

2007-03-15 Thread Kaushalye Kapuruge
, pasting BEGIN...END doing a recompile rerun :D. Hope this helps, Regards, Usman. From: /Kaushalye Kapuruge [EMAIL PROTECTED]/ Reply-To: /openssl-users@openssl.org/ To: /openssl-users@openssl.org

Problem with EVP_Decode and line breaks in a X509 certificate

2007-03-14 Thread Kaushalye Kapuruge
Hi list, I need to get an X509 *cert using string buffer, which is a base64 encoded representation of it. In other words, if I have the contents of a ---BEGIN CERTIFICATE--- and --END CERTIFICATE--- of a .pem file, I need to retrieve the certificate. I used d2i_X509_bio() function for

Re: Problem with EVP_Decode and line breaks in a X509 certificate

2007-03-14 Thread Kaushalye Kapuruge
Hi Patrick, Thanks for the reply. Yes I took that approach but it didn't work. That's why I dig a bit further down and tried locate where exactly the error is. I figured that new lines in the base64 encoded string buffer are necessary to cast a certificate out of it. May be my observation is

Re: Sign using RSA-SHA1

2007-02-14 Thread Kaushalye Kapuruge
Nils Larsch wrote: Kaushalye Kapuruge wrote: Hi List, I need to sign a text using RSA-SHA1. ( http://www.w3.org/2000/09/xmldsig#rsa-sha1 http://www.w3.org/2000/09/xmldsig#rsa-sha1 as per XML-Signature specification http://www.w3.org/TR/xmldsig-core/) I found a set of EVP_ functions to do

Sign using RSA-SHA1

2007-02-13 Thread Kaushalye Kapuruge
Hi List, I need to sign a text using RSA-SHA1. ( http://www.w3.org/2000/09/xmldsig#rsa-sha1 http://www.w3.org/2000/09/xmldsig#rsa-sha1 as per XML-Signature specification http://www.w3.org/TR/xmldsig-core/) I found a set of EVP_ functions to do this. i.e. EVP_SignInit (md_ctx, EVP_sha1());

Re: openssl version 0.9.8b : cannot read the private key

2007-01-10 Thread Kaushalye Kapuruge
Folks, I found another way to get this job done. And it is working on all the versions mentioned. Instead of using PEM_read_bio_PrivateKey() we used d2i_PrivateKey_bio(). Now the key is not NULL. Cheers, Kaushalye Kaushalye Kapuruge wrote: Hi folks, I was trying to read a private key

openssl version 0.9.8b : cannot read the private key

2007-01-09 Thread Kaushalye Kapuruge
Hi folks, I was trying to read a private key (EVP_PKEY)using following test program. But I found that function PEM_read_bio_PrivateKey() gives a NULL value for the EVP_PKEY *key. This happened for openssl version 0.9.8b. I tested with few other versions of openssl (e.g. 0.9.8c and 0.9.7e)

Re: openssl interop with bouncy castle

2006-12-18 Thread Kaushalye Kapuruge
Hi, Sorry to trouble you again. :) I tried the padding approach that I described in my prev mail. But still no luck. I am concerned about the block size given by the EVP_CIPHER_block_size. For example if I'm using 3-DES (block size=8)a buffer of size 64 to call EVP_CipherUpdate and my plain

Re: openssl interop with bouncy castle

2006-12-15 Thread Kaushalye Kapuruge
Marek Marcola wrote: Hello, As an addition to my previous mail, I can decrypt the data that are encrypted by my application. (It's a WS-Security Implementation). But it is not inter-operable with the WSS4J. WSS4J uses bouncy castle crypto package. The reason is that they use ISO 10126

openssl interop with bouncy castle

2006-12-13 Thread Kaushalye Kapuruge
and openssl has it's own padding I really don't know how to overcome with this. Thanks, Kaushalye Kaushalye Kapuruge wrote: Hi List, How do I set ISO10126 padding for AES/3-DES encryption. I found that it is possible to enable/disable padding by using EVP_CIPHER_CTX_set_padding(). But I need

ISO10126 padding in openssl

2006-12-11 Thread Kaushalye Kapuruge
Hi List, How do I set ISO10126 padding for AES/3-DES encryption. I found that it is possible to enable/disable padding by using EVP_CIPHER_CTX_set_padding(). But I need to change the default padding of openssl (rather than enabling or disabling). My code uses typical block cipher encryption

Re: get CA name from user certificate

2006-11-30 Thread Kaushalye Kapuruge
); BIO_free(out); out = NULL; AnsiString issuerTemp(reinterpret_castchar *(result)); ShowMessage(issuerTemp); I tried displaying the issuer using the ShowMessage, but i returned an empty message box. what did i do wrong? thanks a lot On 11/29/06, * Kaushalye Kapuruge* [EMAIL

Re: get CA name from user certificate

2006-11-29 Thread Kaushalye Kapuruge
Ambarish Mitra wrote: You can do something like this: (assuming the cert is a variable -- if the cert is a file in the filesystem, some modificatins is needed) #include ... int main(int argc, char **argv) { X509* pCert; char* str; int ret; char clientCertificate[] =

Re: get CA name from user certificate

2006-11-28 Thread Kaushalye Kapuruge
imin macho wrote: hi i'm really new to this openSSL thingy. is there any function we can use to read/extract CA's name from client certificate? thank you. Macho, You may use following code. Here cert is X509*. Cheers, Kaushalye BIO *out; unsigned char *issuer, *result; int n; out

Re: pkcs#12 in openssl

2006-11-21 Thread Kaushalye Kapuruge
. Is it the unique key to identify a key/cert pair in a key store? Besides there is no way to give such in the parse() function. Giving the same password might appear as a rare case. But that doesn't mean it'll never happen. Cheers, Kaushalye Dr. Stephen Henson wrote: On Tue, Nov 21, 2006, Kaushalye

pkcs#12 in openssl

2006-11-15 Thread Kaushalye Kapuruge
Hi list, I have few questions regarding pkcs#12 implementation in openssl. If I have a pkcs#12 keystore file that keeps more than one certificate in it, 1. How to identify/retrieve a certificate given a private key? 2. How to identify/retrieve a certificate uniquely (is it the private key or

Re: man pages of PKCS12

2006-11-13 Thread Kaushalye Kapuruge
Alexis Lefort wrote: I found a source code in the openssl examples. Could you please point me to a such :) Thanks. But I still don't know how to test the type of the file (X.509 or PKCS#12). Is there a mean to do so? regards Alexis Alexis Lefort a écrit : I have now several other

Use of X509_NAME_oneline

2006-11-03 Thread Kaushalye Kapuruge
Hi list, Here is my code to get the issuer of an X509 certificate in PEM format. I'm using X509_NAME_oneline() to convert the X509_NAME to a string. But the man page discourage the use of it. Is there any other function serves for the same purpose. All I need is to extract meta data like

base64 encode of sha1

2006-10-19 Thread Kaushalye Kapuruge
Hi, I tried to get the base64 encoded result of a SHA1 digest. But the result is not compatible with the same operation in Java. Also I tried to use a javascript function. It is matching with the result of the Java implementation but not with the openssl result. So I guess there is something

Re: base64 encode of sha1

2006-10-19 Thread Kaushalye Kapuruge
Witek wrote: Kaushalye Kapuruge wrote: Hi, I tried to get the base64 encoded result of a SHA1 digest. But the result is not compatible with the same operation in Java. Also I tried to use a javascript function. It is matching with the result of the Java implementation

Re: base64 encode of sha1

2006-10-19 Thread Kaushalye Kapuruge
Kaushalye Kapuruge wrote: Witek wrote: Kaushalye Kapuruge wrote: Hi, I tried to get the base64 encoded result of a SHA1 digest. But the result is not compatible with the same operation in Java. Also I tried to use a javascript function. It is matching with the result of the Java

Re: applicationon crash when call EVP_CIPHER_CTX_init()

2006-09-08 Thread Kaushalye Kapuruge
Frank Büttner wrote: Hello, when I call EVP_CIPHER_CTX_init() in my application it crash. Must I call anything before? Thanks, Frank All you have to do is to declare an EVP_CIPHER_CTX. See the example code. EVP_CIPHER_CTX ctx; EVP_CIPHER_CTX_init(ctx);

EVP_CipherFinal_ex() fails

2006-08-20 Thread Kaushalye Kapuruge
Hi, I tried to encrypt and decrypt a text using different ciphers. There I found that the decryption failes at EVP_CipherFinal_ex() call. Somebody please point me out what I've done wrong. The code is attached. Cheers, Kaushalye #include openssl/evp.h #include openssl/rand.h #include

Re: EVP_CipherFinal_ex() fails

2006-08-20 Thread Kaushalye Kapuruge
Kaushalye Kapuruge wrote: Hi, I tried to encrypt and decrypt a text using different ciphers. There I found that the decryption failes at EVP_CipherFinal_ex() call. Somebody please point me out what I've done wrong. The code is attached. Cheers, Kaushalye

Re: RSA encryption

2006-08-03 Thread Kaushalye Kapuruge
Yeah I rectified it . Sorry I forgot to have u guys posted... :) Actually this should be the private key. Not the public key. RSA_size(prvKey-pkey.rsa) Really appreciate Ur help, Kaushalye Marek Marcola wrote: Hello, Change: strlen((char*)encrypted) to:

RSA encryption

2006-08-02 Thread Kaushalye Kapuruge
Hi, I'm trying to encrypt a Text using a session key and then encrypt that session key using the public key of the reciever side. Can anybody point me to an example in C? For this 1. I need to read the key using PEM format. 2. Generate the session key. 3. Encrypt using RSA Also I'd like to

Re: RSA encryption

2006-08-02 Thread Kaushalye Kapuruge
works but decryption fails. My openssl version is OpenSSL 0.9.7g 11 Apr 2005. What I've done wrong here. Thanks, Kaushalye Bernhard Froehlich wrote: Kaushalye Kapuruge wrote: Hi, I'm trying to encrypt a Text using a session key and then encrypt that session key using the public key

Re: openssl command

2006-07-28 Thread Kaushalye Kapuruge
Kaushal Shriyan wrote: Hi ALL I wanted a PDF format of openssl command, Can any one explain me about openssl command with examples I mean How do i use it If you are looking for a openssl guide, please visit these pages. http://www.madboa.com/geek/openssl/ http://sial.org/howto/openssl/

Re: Decryption fails

2006-07-26 Thread Kaushalye Kapuruge
Marek Marcola wrote: Hello, Im trying to encrypt/decrypt a string using openssl. The program works fine for encryption but fails(not always) for decryption. This happens in EVP_CipherFinal_ex() call. I'm a bit confused with this random behavior. I've attached the code. Can anybody point

Decryption fails

2006-07-25 Thread Kaushalye Kapuruge
Hi, Im trying to encrypt/decrypt a string using openssl. The program works fine for encryption but fails(not always) for decryption. This happens in EVP_CipherFinal_ex() call. I'm a bit confused with this random behavior. I've attached the code. Can anybody point me out what I'm doing wrong

Re: cert info?

2006-07-25 Thread Kaushalye Kapuruge
Marten Lehmann wrote: Hello, how can I view the information that are contained in a CSR, KEY or CRT-file? E.g. for which hostname a cert is issued, when it will expire, who is the company it is issued for ... U may find this is useful. http://sial.org/howto/openssl/self-signed/ Cheers,

Re: openssl for xml

2006-07-13 Thread Kaushalye Kapuruge
Hi, Thanks for the help. This example uses EVP_rc2() If I need to use a block cipher such as DES, I have to use IV and padding. Can you direct me to such a sample code.? I dont think this will work If I replace Evp_rc2 with EVP_des_cbc() -Cheers, Kau Marek Marcola wrote: Hello, I'd like

Re: openssl for xml

2006-07-13 Thread Kaushalye Kapuruge
() encryption 3 times? Thanks, Kaushalye Kaushalye Kapuruge wrote: Hi, Thanks for the help. This example uses EVP_rc2() If I need to use a block cipher such as DES, I have to use IV and padding. Can you direct me to such a sample code.? I dont think this will work If I replace Evp_rc2 with EVP_des_cbc

openssl for xml

2006-07-12 Thread Kaushalye Kapuruge
Hi, I need to write an xml security library to encrypt and decrypt xml documents. For that I need to use openssl as the crypto library and do not have a clear idea how to use it for block ciphers(e.g. DES). Later I have to support signing as well. Can somebody direct me to few openssl samples

Re: openssl for xml

2006-07-12 Thread Kaushalye Kapuruge
a library for XMLSig and XMLEnc that uses OpenSSL. http://www.aleksey.com/xmlsec/ Reg Wu Dixer Kaushalye Kapuruge schrieb: Hi, I need to write an xml security library to encrypt and decrypt xml documents. For that I need to use openssl as the crypto library and do not have a clear idea how