Re: (solved) valgrind complaints about my network data receive
Bobby Krupczak wrote: 1) In bn_rand.c add at line 141: memset(buf, 0, bytes); =20 buf = (unsigned char *)OPENSSL_malloc(bytes); if (buf == NULL) { BNerr(BN_F_BNRAND,ERR_R_MALLOC_FAILURE); goto err; } memset(buf, 0, bytes); 2) bn_mont.c: Initialize tmod variable declared at line 392 memset(tmod, 0, sizeof(tmod)); Maybe these two items are genuine bugs ? If some code should be using calloc() instead of malloc() in the first case ? You have have any simple code that exposes those bugs, simply meaning just a page of code that when run under valgrind exposes uninit'ed data is being used (even after a -DPURIFY version of OpenSSL is used). Darryl __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
RE: crypto library in openssl
-Original Message- From: Richard Levitte [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 7:21 PM To: openssl-users@openssl.org; Xu, Qiang (FXSGSC) Subject: Re: crypto library in openssl You're doing three mistakes: 1. you're assuming the EVP routines treat your data as character strings. That's incorrect, it treats them as binary blobs. Any of the bytes in that blob can be zero, and apparently, you're getting a result that starts with a zero byte. 2. you're not using the resulting length from the EVP routines. Doing so will give you correct answer, strlen() is not guaranteed to do that (it will only give you the correct answer if you have no zero byte anywhere in the result). 3. you're also not checking the returned result from the EVP routines. It turns out that the pass phrase used in encryption and decryption process makes a difference. Originally, it is benspassword, after I changed it to MBPDBHRBW123456, it works perfectly. Although I am happy that the problem is solved, I am still a bit confused here: Should there be some requirement on the pass phrase? In my understanding, any pass phrase should be OK, in the condition that the same one is used both in encryption and in decryption. Any clarification on this, Richard? Thanks you, Xu Qiang __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
Re: openssl-0.9.8g on Solaris core dumps?
I'm curious is anyone has solved the problem that Jorgen Lundman posted about last year. I too have run into the issue where openssl builds when forced to 32 bit mode, but then just core dumps. The thread I'm referencing is here: http://www.mail-archive.com/openssl-users@openssl.org/msg51592.html __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
OpenSSL OCSP error
Dear Openssl developer, At the moment i have some problems with the OCSP function. I'm getting a Error querying OCSP responsder Error message: C:\OpenSSL\binOpenSSL ocsp -url http://ocsp.openvalidation.org -issuer RootCAce rt.pem -VAfile OCSPServer.pem -cert User.pem Error querying OCSP responsder 3024:error:27070072:OCSP routines:OCSP_sendreq_bio:server response error:.\crypt o\ocsp\ocsp_ht.c:147:Code=500,Reason=Internal Error I found out on the OpenSSL support board that this is a known issue in OpenSSL 0.97 and higher (?)I tried almost every version of OpenSSL (0.97till 0.98g) but i didnt found any Win32 build that don't have this bug. I found some C code to repair this problemen, but i don't have any Compilter knowhow to recompile a working version. Thanks for any reply. Greetings Henk
RE: crypto library in openssl
-Original Message- From: Richard Levitte [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 7:21 PM To: openssl-users@openssl.org; Xu, Qiang (FXSGSC) Subject: Re: crypto library in openssl Note: openssl-dev is inappropriate, as it is meant for the _development_ _of_ OpenSSL. Your inquiry is about the _use_ of OpenSSL, making openssl-users much more appropriate. I'm therefore redirecting it there. Thanks for redirecting me to the correct group. I didn't realized it yesterday. You're doing three mistakes: 1. you're assuming the EVP routines treat your data as character strings. That's incorrect, it treats them as binary blobs. Any of the bytes in that blob can be zero, and apparently, you're getting a result that starts with a zero byte. Just got to understand this a little bit. Sorry for my slowness. 2. you're not using the resulting length from the EVP routines. Doing so will give you correct answer, strlen() is not guaranteed to do that (it will only give you the correct answer if you have no zero byte anywhere in the result). Could you give me any suggestions to improve the code the decrypt the password? How to check the resulting length from EVP routines? 3. you're also not checking the returned result from the EVP routines. If the result of decryption has zero bytes in it, how can I get the correct char string from it? My idea is to check the byte in the resulting length from EVP routines, and rip the zeros of the result. Is it feasible? Thanks a lot, Xu Qiang __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
What are the proper flags for Endianness and 32Bit
I'm compiling for a 32Bit embedded environment and am working modifying the Makefile to successfully compile. I've run into a couple of errors regarding endianness and 64bit types. 1. I'm using -DL_ENDIAN as a CFLAG but run into an error when including ieeefp.h. Can someone explain the proper flag (it could be overriden using __IEEE_LITTLE_ENDIAN but not clear if this is proper). 2. sha.h has @ line 161... #if (defined(_WIN32) || defined(_WIN64)) !defined(__MINGW32__) #define SHA_LONG64 unsigned __int64 #define U64(C) C##UI64 #elif defined(__arch64__) #define SHA_LONG64 unsigned long #define U64(C) C##UL #else #define SHA_LONG64 unsigned long long #define U64(C) C##ULL #endif How do I declare a 32bit environment? My target is not windows but an embedded OS. Does someone have insight into this? -- View this message in context: http://www.nabble.com/What-are-the-proper-flags-for-Endianness-and-32Bit-tp16041948p16041948.html Sent from the OpenSSL - User mailing list archive at Nabble.com. __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
X0509_free undefined when linking static library to shared object
Hi folks, I googled the web, but couldn't find anything relevant, so hoping that e-mailing the gurus on this list can help: Running on x64 Linux box. I am trying to link the static OpenSSL library with my application .so shared library. Here are the gcc link options that I am using: --- gcc $EXTRA_C_FLAGS -shared -Bsymbolic -o ${prog}.so ${prog}.o -lc -lpthread -lssl --- This results in the following .so file: --- ldd db2auth.so libc.so.6 = /lib64/tls/libc.so.6 (0x002a95677000) libdl.so.2 = /lib64/libdl.so.2 (0x002a9589f000) libpthread.so.0 = /lib64/tls/libpthread.so.0 (0x002a959a2000) libssl.so.0.9.7 = /usr/lib64/libssl.so.0.9.7 (0x002a95ab6000) /lib64/ld-linux-x86-64.so.2 (0x00552000) libcrypto.so.0.9.7 = /usr/lib64/libcrypto.so.0.9.7 (0x002a95bed000) --- So far so good. However when my db2auth.so library is loaded by an application, the application detects the following undefined symbol: /usr/lib64/libssl.so.0.9.7: undefined symbol: X509_free As a result the application fails. I don't have a problem when the same code is compiled as part of a static executable (i.e. no undefined symbol), however I also need to build a workable .so as well. Does anybody have any suggestions on what to do (e.g. perhaps this issue doesn't exist with a later OpenSSL release or maybe there is some magic gcc linker directive)? Thanks in advance, Gene
MAC
Is there a driver available for MAC using ActivClient CAC 6.1? If so where is it available. Thanks Jim Main C-130JMATS Simcert/QA Detachment 3, AMCAOS 626 Sixth St. Little Rock AFB AR, 72099 DSN 731-6606Comm. 501-987-6606 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Re: OpenSSL FIPS 1.1.2 on Windows
On Fri, Mar 14, 2008, Sisyphus wrote: Rather than digging, I opted for simply linking to my openssl-0.9.8g (static) libcrypto.a by entering the 'test' directory and running: You can't modify the build process in any way or it violates the security policy and the resulting library is not validated. Steve. -- Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage OpenSSL project core developer and freelance consultant. Homepage: http://www.drh-consultancy.demon.co.uk __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
Re: OpenSSL FIPS 1.1.2 on Windows
On Thu, Mar 13, 2008, Scholl, Ben M. wrote: Steve, I followed your procedure, and this time it actually looks like it worked. I am confused at what I need to do now to use this build. I ran this command: ~\apps\openssl version It returned: OpenSSL 0.9.7j-fips-dev XX xxx Is this the expected result? Do I need to then build another version of OpenSSL and link to this one somehow, or is this a usable FIPS version? My ultimate goal is to create a key and certificate request using a FIPS version of OpenSSL and then somehow use OpenSSL as my Tomcat 6 SSLEngine. Currently I have no idea how to accomplish any of this. Any help you can provide is much appreciated. Yes that is the expected result. You can use that version of OpenSSL as is but it is rather ancient (due to the long timescale of the validation process). If you want to use VC++ for development you have to link a recent version of OpenSSL 0.9.7 against the validated module. Instructions are in the user guide see: http://www.openssl.org/docs/fips/UserGuide-1.1.1.pdf Steve. -- Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage OpenSSL project core developer and freelance consultant. Homepage: http://www.drh-consultancy.demon.co.uk __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
Re: openssl-0.9.8g on Solaris core dumps?
Hi! I'm curious is anyone has solved the problem that Jorgen Lundman posted about last year. I too have run into the issue where openssl builds when forced to 32 bit mode, but then just core dumps. The thread I'm referencing is here: http://www.mail-archive.com/openssl-users@openssl.org/msg51592.html Have you tried building with the sun compilers? They are free to download and use. The core-dumping problem, with the 32-bit library, went away when I switched compilers. Bobby __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
Re: (solved) valgrind complaints about my network data receive
Hi! Bobby Krupczak wrote: 1) In bn_rand.c add at line 141: memset(buf, 0, bytes); =20 buf = (unsigned char *)OPENSSL_malloc(bytes); if (buf == NULL) { BNerr(BN_F_BNRAND,ERR_R_MALLOC_FAILURE); goto err; } memset(buf, 0, bytes); 2) bn_mont.c: Initialize tmod variable declared at line 392 memset(tmod, 0, sizeof(tmod)); Maybe these two items are genuine bugs ? If some code should be using calloc() instead of malloc() in the first case ? You have have any simple code that exposes those bugs, simply meaning just a page of code that when run under valgrind exposes uninit'ed data is being used (even after a -DPURIFY version of OpenSSL is used). The example client/server code from the book NSwO demonstrated the problem even after -DPURIFY was used to build openssl. I'm not sure it is a bug or not. I guess it would be up to the openssl maintainers and developers to decide. Thanks, Bobby __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
RE: crypto library in openssl
-Original Message- From: Richard Levitte [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 7:21 PM To: openssl-users@openssl.org; Xu, Qiang (FXSGSC) Subject: Re: crypto library in openssl You're doing three mistakes: 1. you're assuming the EVP routines treat your data as character strings. That's incorrect, it treats them as binary blobs. Any of the bytes in that blob can be zero, and apparently, you're getting a result that starts with a zero byte. 2. you're not using the resulting length from the EVP routines. Doing so will give you correct answer, strlen() is not guaranteed to do that (it will only give you the correct answer if you have no zero byte anywhere in the result). 3. you're also not checking the returned result from the EVP routines. Now i am adding code to check the resulting lenght from EVP routines: = #define ESS_CRYPTO_CRYPT_BUFFER_SIZE (56) .. bool_t esscrypto_decryptString(unsigned char *toDecrypt, unsigned char *passPhrase, int sizeOfStrToDecrypt, int maxDecryptedStringSize, int *sizeOfDecryptedString, unsigned char **decryptedString) { EVP_CIPHER_CTX openSSLDecryptionStructure; int tempOutputLength = 0; int i = 0; int tmpOutputBufferPosition = 0; int tmpOffset = 0; char *tempPassPhrase = NULL; int currentDecryptedStrLength = 0; char *tempPtr = NULL; .. for (i = 0; i sizeOfStrToDecrypt/ ESS_CRYPTO_CRYPT_BUFFER_SIZE; i++) { /* decrypt the contents of the buffer */ EVP_DecryptUpdate(openSSLDecryptionStructure, ((*decryptedString)[tmpOutputBufferPosition]), tmpOffset, toDecrypt[tmpOutputBufferPosition], ESS_CRYPTO_CRYPT_BUFFER_SIZE); /* Increment the position we are at in decrypting the string */ tmpOutputBufferPosition = tmpOutputBufferPosition + tmpOffset; LOGFORCE(EVP_DecryptUpdate1: tmpOffset is %d, tmpOffset); //xq } .. /* * if there is data left to decrypt that did not fit exactly within * the buffer, decrypt that remaining bit. **/ if ( sizeOfStrToDecrypt % ESS_CRYPTO_CRYPT_BUFFER_SIZE) { /* decrypt the contents of the buffer */ EVP_DecryptUpdate(openSSLDecryptionStructure, ((*decryptedString)[tmpOutputBufferPosition]), tmpOffset, toDecrypt[tmpOutputBufferPosition], sizeOfStrToDecrypt % ESS_CRYPTO_CRYPT_BUFFER_SIZE); /* Increment the position we are at in decrypting the string */ tmpOutputBufferPosition = tmpOutputBufferPosition + tmpOffset; LOGFORCE(EVP_DecryptUpdate2: tmpOffset is %d, tmpOffset); //xq } .. /* finalize the results from decryption (check CRC) */ EVP_DecryptFinal(openSSLDecryptionStructure, ((*decryptedString)[tmpOutputBufferPosition]), tmpOffset); LOGFORCE(EVP_DecryptFinal: tmpOffset is %d, tmpOffset); //xq /* set the final length of the decrypted string */ *sizeOfDecryptedString = tmpOutputBufferPosition + tmpOffset; LOGFORCE(*sizeOfDecryptedString is %d, *sizeOfDecryptedString); for (i = 0; i *sizeOfDecryptedString; i++) { LOGFORCE(char in final result is %c, (*decryptedString)[i]); } .. = The lenght of the password $elkins02 is only 9 characters, far less than ESS_CRYPTO_CRYPT_BUFFER_SIZE (56), so only the later two LOGFORCE are recorded. But still, the error seems to come from EVP APIs. For user with password #elkins02, the log is: = smbipc (Thu Mar 13 2008 02:50:39.354) p17565,t16384,essCrypto.c,563 INFO Decrypting string (in hex) [AAC893A997A6E21FD2A2D2D4F205133B] smbipc (Thu Mar 13 2008 02:50:39.364) p17565,t16384,essCrypto.c,682 INFO EVP_DecryptUpdate2: tmpOffset is 8 smbipc (Thu Mar 13 2008 02:50:39.364) p17565,t16384,essCrypto.c,690 INFO EVP_DecryptFinal: tmpOffset is 1 smbipc (Thu Mar 13 2008 02:50:39.364) p17565,t16384,essCrypto.c,695 INFO *sizeOfDecryptedString is 9 = This is correct. For user with password $elkins02, the log is: = smbipc (Thu Mar 13 2008 02:51:22.509) p17565,t16384,essCrypto.c,563 INFO Decrypting string (in hex) [7208148B96ABDC] smbipc (Thu Mar 13 2008 02:51:22.509) p17565,t16384,essCrypto.c,682 INFO EVP_DecryptUpdate2: tmpOffset is 0 smbipc (Thu Mar 13 2008 02:51:22.517) p17565,t16384,essCrypto.c,690 INFO EVP_DecryptFinal: tmpOffset is 0 smbipc (Thu Mar 13
Re: OpenSSL FIPS 1.1.2 on Windows
- Original Message - From: Dr. Stephen Henson [EMAIL PROTECTED] To: openssl-users@openssl.org Sent: Friday, March 14, 2008 10:09 PM Subject: Re: OpenSSL FIPS 1.1.2 on Windows On Fri, Mar 14, 2008, Sisyphus wrote: Rather than digging, I opted for simply linking to my openssl-0.9.8g (static) libcrypto.a by entering the 'test' directory and running: You can't modify the build process in any way or it violates the security policy and the resulting library is not validated. Heh ... but if I don't modify the build process, then it won't build. (Not much security in that :-) The 2 executables that threw up this problem for me are created in a directory named 'test'. Does that mean they are merely part of the test suite ? Does 'make test' run ok for you ? Cheers, Rob __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
RE: OpenSSL FIPS 1.1.2 on Windows
Steve, Just to be clear, I can use this file, ~\app\openssl, to generate a key and certificate request that will be FIPS compliant? How can I tell Tomcat to use this built version of OpenSSL as the SSLEngine? Thank you, Ben M. Scholl Ennovex Solutions, Inc. Software Engineer DoD PKE Engineering Phone: 703-933-9064 Fax: 703-933-9067 www.ennovex.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dr. Stephen Henson Sent: Friday, March 14, 2008 7:12 AM To: openssl-users@openssl.org Subject: Re: OpenSSL FIPS 1.1.2 on Windows On Thu, Mar 13, 2008, Scholl, Ben M. wrote: Steve, I followed your procedure, and this time it actually looks like it worked. I am confused at what I need to do now to use this build. I ran this command: ~\apps\openssl version It returned: OpenSSL 0.9.7j-fips-dev XX xxx Is this the expected result? Do I need to then build another version of OpenSSL and link to this one somehow, or is this a usable FIPS version? My ultimate goal is to create a key and certificate request using a FIPS version of OpenSSL and then somehow use OpenSSL as my Tomcat 6 SSLEngine. Currently I have no idea how to accomplish any of this. Any help you can provide is much appreciated. Yes that is the expected result. You can use that version of OpenSSL as is but it is rather ancient (due to the long timescale of the validation process). If you want to use VC++ for development you have to link a recent version of OpenSSL 0.9.7 against the validated module. Instructions are in the user guide see: http://www.openssl.org/docs/fips/UserGuide-1.1.1.pdf Steve. -- Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage OpenSSL project core developer and freelance consultant. Homepage: http://www.drh-consultancy.demon.co.uk __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED] __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
Re: OpenSSL FIPS 1.1.2 on Windows
On Fri, Mar 14, 2008, Sisyphus wrote: On Fri, Mar 14, 2008, Sisyphus wrote: Rather than digging, I opted for simply linking to my openssl-0.9.8g (static) libcrypto.a by entering the 'test' directory and running: You can't modify the build process in any way or it violates the security policy and the resulting library is not validated. Heh ... but if I don't modify the build process, then it won't build. (Not much security in that :-) Well if you don't mind the result being not validated you can of course modify the build process, sources anything else in any way you choose. However some of the queries here are from people who *do* want a validated library and for them they have to obey the build instructions verbatim. I don't make the rules, I'm just the messenger here ;-) The 2 executables that threw up this problem for me are created in a directory named 'test'. Does that mean they are merely part of the test suite ? Does 'make test' run ok for you ? make test isn't a necessary part of the approved build procedure as long as: ./config fips make make install works (including compilation completeing without errors) the result is validated. Steve. -- Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage OpenSSL project core developer and freelance consultant. Homepage: http://www.drh-consultancy.demon.co.uk __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
Accessing encrypted messages after cert expires
Hi All, I am not sure what happens under the following scenario. I use an SSL certificate (e.g. from CaCert.org) to encrypt and sign a file and or an email message. Later on the certificate expires. I renew the certificate, load it up on my browser/mail client. Can I then use my mail client to decrypt and read the file and message that I encrypted previously, with the since expired cert? -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: Accessing encrypted messages after cert expires
Hi Mick: On Friday 14 March 2008 16:43:28 Mick wrote: Hi All, I am not sure what happens under the following scenario. I use an SSL certificate (e.g. from CaCert.org) to encrypt and sign a file and or an email message. Later on the certificate expires. I renew the certificate, load it up on my browser/mail client. Can I then use my mail client to decrypt and read the file and message that I encrypted previously, with the since expired cert? Actually, what you care about are the keys associated with the certificate. For encryption, you've got content that is encrypted with the public key, and decryptable only with the private key. Since the certificate is your public key signed by some Certificate Authority or other (or, itself), then after the certificate expires, most software will not let you or others encrypt things with that public key. However, since you are still in possession of the private key, you should still be able to decrypt everything just fine. Now, if you get a new certificate, most of the time, that will mean that you generated a new private/public key pair, and had the new public key signed by a CA. So, you will now have 2 private keys to protect - the one used to decrypt old content, and the one used to decrypt new content. Some people decide that having two keys to protect is a bad thing, and they just simply decrypt all of the old data with the old private key, and re-encrypt it with the new public key, after which they destroy their old private key. How you manage this is largely a matter of policy (either the CA's, your company's, or your own personal policy). Hope that helps clear things up. --- Patrick Patterson Chief PKI Architect Carillon Information Security Inc. http://www.carillon.ca __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
Re: Accessing encrypted messages after cert expires
On Friday 14 March 2008, Patrick Patterson wrote: Hi Mick: On Friday 14 March 2008 16:43:28 Mick wrote: Hi All, I am not sure what happens under the following scenario. I use an SSL certificate (e.g. from CaCert.org) to encrypt and sign a file and or an email message. Later on the certificate expires. I renew the certificate, load it up on my browser/mail client. Can I then use my mail client to decrypt and read the file and message that I encrypted previously, with the since expired cert? Actually, what you care about are the keys associated with the certificate. For encryption, you've got content that is encrypted with the public key, and decryptable only with the private key. Since the certificate is your public key signed by some Certificate Authority or other (or, itself), then after the certificate expires, most software will not let you or others encrypt things with that public key. However, since you are still in possession of the private key, you should still be able to decrypt everything just fine. Now, if you get a new certificate, most of the time, that will mean that you generated a new private/public key pair, and had the new public key signed by a CA. So, you will now have 2 private keys to protect - the one used to decrypt old content, and the one used to decrypt new content. Some people decide that having two keys to protect is a bad thing, and they just simply decrypt all of the old data with the old private key, and re-encrypt it with the new public key, after which they destroy their old private key. How you manage this is largely a matter of policy (either the CA's, your company's, or your own personal policy). Hope that helps clear things up. Yes it does. Keeping the same private key and generating new public key with it seems to be a sensible thing to do from a practical point of view. Thank you very much. -- Regards, Mick signature.asc Description: This is a digitally signed message part.