Re: openssl 1.1.1k on solaris 2.6 sparc

2021-06-24 Thread Jeff Wieland

Michael Wojcik wrote:

From: openssl-users  On Behalf Of david 
raingeard
Sent: Thursday, 24 June, 2021 07:06
I compiled it using sun compiler, with some modifications to the source code.

If memory serves, OpenSSL doesn't work on Solaris SPARC if built using the Sun 
compiler. You have to use GCC. I'm pretty sure we discovered this in our SPARC 
product builds.

This, and some other platform issues (there's one with GCC optimization on x86 
64-bit, the details of which escape me now), are things I keep hoping to find 
time to dig into, but more-pressing work never seems to ease up.

--
Michael Wojcik


You can build it on Solaris 10 SPARC, using Studio 12.2 for 32 bit, and
Studio 12.4 for 64 bit.  Make sure that these are fully patched up.

--
Jeff Wieland, UNIX Systems Administrator
Purdue University IT Infrastructure Services UNIX Platforms



Re: building openssl 1.1.1 for Solaris 10

2020-04-08 Thread Jeff Wieland

Michael Wojcik wrote:

From: tim.j.culh...@gmail.com [mailto:tim.j.culh...@gmail.com]
Sent: Tuesday, April 07, 2020 01:25

I ran the gmake  and it fails with the below  ld errors.

Is this the  known issue mentioned previously with building openssl on Sparc
or is it caused by something else?

...

Undefined first referenced
symbol in file
clock_gettime ./libcrypto.so

It appears that's a known issue with building OpenSSL 1.1.1 on Solaris 10. (I 
think we haven't run into this in my team because we're now on Solaris 11, but 
I haven't investigated.)

Quanah Gibson-Mount mentioned this in a reply to your first post in this thread:


They may have run into <https://github.com/openssl/openssl/issues/6333>
which the OpenSSL project seems disinclined to fix.

If you look at that issue, you'll see people have posted workarounds. I believe 
it's just a matter of linking with an additional library.

--
Michael Wojcik
Distinguished Engineer, Micro Focus





On Solaris 10, you need to link with -lrt to pick up the clock_gettime
functions.  If you do something like "export LDFLAGS='-lrt'" before you
invoke Configure, it should work.

--
Jeff Wieland, UNIX/Network Systems Administrator
Purdue University IT Infrastructure Services UNIX Platforms



[openssl-users] Which protocols should my client support?

2017-04-24 Thread Jeff Archer
I think this is a silly question but I still would like to get a
knowledgeable and experienced confirmation of my thinking.

My client is a custom application and as such only needs to communicate
with specific servers for specific purposes.  I think it makes sense for my
client to only support the specific protocol that my server will use,
ECDHE-RSA-AES128-GCM-SHA256.  Does this sound reasonable or should I also
include others as well?

My thinking is that if the servers are changed one day, it would only be
for increasing security and thus I will probably need to update to latest
OpenSSL and so will be updating my app at this time anyway.  Also, since
they are my companies servers, I will be notified ahead of time that change
is coming.

T
​hanks,
​
Jeff
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] How do I connect to this server

2017-04-24 Thread Jeff Archer
>> https://username:passw...@server.com
>> How do I specify this username and password when using SSL_connect()?
>
>You don't.  That stuff is at the protocol level about TLS/SSL.

OK. Let me try to rephrase my question.  Please excuse me if I don't get
terminology exactly correct I am a novice user of OpenSSL and encryption in
general.

I need to make a connection to this server from my app. The server will
only allow TLS1.2 connections and requires username/password.  Other than
the additional username/password I have working code which is working
against a demo server which does not require this additional
username/password.

I am able to connect to the user using a browser by putting the
username/password into the url.  This proves that I know the correct
username/password but has no other relevance.





Jeff Archer
jeffarch...@gmail.com <jarch...@yahoo.com>


On Fri, Apr 21, 2017 at 6:29 PM, Salz, Rich via openssl-users <
openssl-users@openssl.org> wrote:

> > https://username:passw...@server.com
> > How do I specify this username and password when using SSL_connect()?
>
> You don't.  That stuff is at the protocol level about TLS/SSL.
>
>
> --
> openssl-users mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
>
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


[openssl-users] How do I connect to this server

2017-04-21 Thread Jeff Archer
I have a server that requires that username and password be used as
https://username:passw...@server.com

How do I specify this username and password when using SSL_connect()?

Thanks,
Jeff
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Build problems on Windows

2017-01-10 Thread jeff saremi
thanks a lot. I opened a "VS2015 x64 Native Tools" window as opposed to a 
"VS2015 x64 x86 Cross Tools" and everything worked amazingly with no issues.

The names are super confusing.

but i'm ok now. thanks


From: openssl-users <openssl-users-boun...@openssl.org> on behalf of Jeffrey 
Walton <noloa...@gmail.com>
Sent: Tuesday, January 10, 2017 11:52 AM
To: OpenSSL Users
Subject: Re: [openssl-users] Build problems on Windows


IF EXIST libcrypto-1_1-x64.dll.manifest DEL /F /Q 
libcrypto-1_1-x64.dll.manifest
link /nologo /debug /dll  /implib:libcrypto.lib 
/out:libcrypto-1_1-x64.dll /def:libcrypto-1_1-x64.def 
@C:\Users\jesaremi\AppData\Local\Temp\nm8557.tmp || (DEL /Q libcrypto.* 
libcrypto-1_1-x64.* && EXIT 1)
crypto\aes\aes_cfb.obj : fatal error LNK1112: module machine type 'X86' 
conflicts with target machine type 'x64'
NMAKE : fatal error U1077: 'link' : return code '0x1'
Stop.

It sounds like the wrong Developer Tools Command Prompt was opened. You can 
find them through Start -> Programs -> Visual Studio  -> Developer Tools. 
Also see https://msdn.microsoft.com/en-us/library/ms229859(v=vs.110).aspx .
Developer Command Prompt for Visual 
Studio<https://msdn.microsoft.com/en-us/library/ms229859(v=vs.110).aspx>
msdn.microsoft.com
The Developer Command Prompt for Visual Studio automatically sets the 
environment variables that enable you to easily use .NET Framework tools.



If you plan on building for x86 and you configure for VC-WIN32, then be sure 
you open the x86 command prompt, and not the x64 one.

If you want to build for x64, then be sure to configure with VC-WIN64A, and be 
sure to open a x64 developer command prompt.

If you have the correct command prompt open, then perform a clean or distclean. 
You may have old artifacts lying around.

Jeff
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Build problems on Windows

2017-01-10 Thread jeff saremi
I installed ActivePerl and got a lot further

I now get link errors. Please see below. The commands are the same: perl 
Configure VS-WIN64A and nmake:


"C:\Perl64\bin\perl.exe" "util\mkdef.pl" "crypto" 32 > 
libcrypto-1_1-x64.def
"C:\Perl64\bin\perl.exe" -i.tmp -pe "s|^LIBRARY\s+crypto32|LIBRARY 
libcrypto-1_1-x64|;" libcrypto-1_1-x64.def
DEL libcrypto-1_1-x64.def.tmp
"C:\Perl64\bin\perl.exe" "util\mkrc.pl" libcrypto-1_1-x64.dll > 
libcrypto-1_1-x64.rc
rc /folibcrypto-1_1-x64.res libcrypto-1_1-x64.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.17336
Copyright (C) Microsoft Corporation.  All rights reserved.

IF EXIST libcrypto-1_1-x64.dll.manifest DEL /F /Q 
libcrypto-1_1-x64.dll.manifest
link /nologo /debug /dll  /implib:libcrypto.lib 
/out:libcrypto-1_1-x64.dll /def:libcrypto-1_1-x64.def 
@C:\Users\jesaremi\AppData\Local\Temp\nm8557.tmp || (DEL /Q libcrypto.* 
libcrypto-1_1-x64.* && EXIT 1)
crypto\aes\aes_cfb.obj : fatal error LNK1112: module machine type 'X86' 
conflicts with target machine type 'x64'
NMAKE : fatal error U1077: 'link' : return code '0x1'
Stop.




From: openssl-users  on behalf of Jakob Bohm 

Sent: Tuesday, January 10, 2017 11:20 AM
To: openssl-users@openssl.org
Subject: Re: [openssl-users] Build problems on Windows

On 10/01/2017 19:43, Matt Caswell wrote:
>   Notes on Perl on Windows
>   
>
>   There are a number of build targets that can be viewed as "Windows".
>   Indeed, there are VC-* configs targeting VisualStudio C, as well as
>   MinGW and Cygwin. The key recommendation is to use "matching" Perl,
>   one that matches build environment. For example, if you will build
>   on Cygwin be sure to use the Cygwin package manager to install Perl.
>   For MSYS builds use the MSYS provided Perl. For VC-* builds we
>   recommend ActiveState Perl, available from
>   http://www.activestate.com/ActivePerl.
ActivePerl | ActiveState
www.activestate.com
ActivePerl Business and Enterprise Editions feature our precompiled, supported, 
quality-assured Perl distribution used by millions of developers around the 
world for ...


>
Really?, I thought ActiveState ActivePerl was pretty much dead/historic.

While I have not bothered with OpenSSL 1.1.x builds yet, I usually use
Strawberry Perl for VC-related work, and it seems to work fine with the
1.0.2 sources.  Since I have not tested with 1.1.x sources, this is
obviously not intended as advice to people trying to build, more as
something you might consider for an updated version of NOTES.PERL
(after testing it of cause).

Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
[https://www.wisemo.com/wp-content/uploads/WMO_03.jpg]

WiseMo A/S · Remote desktop control of Smartphones ...
www.wisemo.com
WiseMo provides remote desktop access from anywhere. Secure, fast and stable 
remote control software for Tablet, Smartphone and PC


Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Build problems on Windows

2017-01-10 Thread jeff saremi
i was not aware of that. thanks so much. I'll go back and install a proper Perl



From: openssl-users <openssl-users-boun...@openssl.org> on behalf of Matt 
Caswell <m...@openssl.org>
Sent: Tuesday, January 10, 2017 10:43 AM
To: openssl-users@openssl.org
Subject: Re: [openssl-users] Build problems on Windows



On 10/01/17 18:34, jeff saremi wrote:
> D:\repos\openssl2\openssl-1.1.0c>perl -v
>
> This is perl 5, version 22, subversion 1 (v5.22.1) built for
> x86_64-msys-thread-multi
> Copyright 1987-2015, Larry Wall

You are using msys perl but doing a VC build.

See this extract from NOTES.PERL in the distribution:

 Notes on Perl on Windows
 

 There are a number of build targets that can be viewed as "Windows".
 Indeed, there are VC-* configs targeting VisualStudio C, as well as
 MinGW and Cygwin. The key recommendation is to use "matching" Perl,
 one that matches build environment. For example, if you will build
 on Cygwin be sure to use the Cygwin package manager to install Perl.
 For MSYS builds use the MSYS provided Perl. For VC-* builds we
 recommend ActiveState Perl, available from
 http://www.activestate.com/ActivePerl.
ActivePerl | ActiveState<http://www.activestate.com/ActivePerl>
www.activestate.com
ActivePerl Business and Enterprise Editions feature our precompiled, supported, 
quality-assured Perl distribution used by millions of developers around the 
world for ...




Matt


>
>
>
> 
> *From:* openssl-users <openssl-users-boun...@openssl.org> on behalf of
> Jakob Bohm <jb-open...@wisemo.com>
> *Sent:* Monday, January 9, 2017 9:46 PM
> *To:* openssl-users@openssl.org
> *Subject:* Re: [openssl-users] Build problems on Windows
>
> On 10/01/2017 05:04, jeff saremi wrote:
>>
>> Hello
>>
>> I downloaded openssl-1.1.0c and i'm trying to build this on Windows 10
>> using Visual Studio 2015. I'm following the INSTALL and NOTES.WIN
>> instructions however I get stopped rather quickly with file not found
>> issues..
>>
>> I have also installed nasm. The build fails for 32 or 64 with slightly
>> different paths in the error. Here's the sequence of commands:
>> 1.perl Configure VC-WIN32
>> 2.nmake
>>
>>
>> output:
>>
>> D:\repos\openssl-1.1.0c>perl Configure VC-WIN64A
>> Configuring OpenSSL version 1.1.0c (0x1010003fL)
>> no-asan [default]  OPENSSL_NO_ASAN
>> no-crypto-mdebug [default]  OPENSSL_NO_CRYPTO_MDEBUG
>> no-crypto-mdebug-backtrace [default]
>> OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
>> no-ec_nistp_64_gcc_128 [default] OPENSSL_NO_EC_NISTP_64_GCC_128
>> no-egd  [default]  OPENSSL_NO_EGD
>> no-fuzz-afl [default]  OPENSSL_NO_FUZZ_AFL
>> no-fuzz-libfuzzer [default]  OPENSSL_NO_FUZZ_LIBFUZZER
>> no-heartbeats   [default]  OPENSSL_NO_HEARTBEATS
>> no-md2  [default]  OPENSSL_NO_MD2 (skip dir)
>> no-msan [default]  OPENSSL_NO_MSAN
>> no-rc5  [default]  OPENSSL_NO_RC5 (skip dir)
>> no-sctp [default]  OPENSSL_NO_SCTP
>> no-ssl-trace[default]  OPENSSL_NO_SSL_TRACE
>> no-ssl3 [default]  OPENSSL_NO_SSL3
>> no-ssl3-method  [default]  OPENSSL_NO_SSL3_METHOD
>> no-ubsan[default]  OPENSSL_NO_UBSAN
>> no-unit-test[default]  OPENSSL_NO_UNIT_TEST
>> no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS
>> no-zlib [default]
>> no-zlib-dynamic [default]
>> Configuring for VC-WIN64A
>> CC=cl
>> CFLAG =-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32
>> -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -DUNICODE
>> -D_UNICODE /MD /O2
>> SHARED_CFLAG  =
>> DEFINES   =OPENSSL_USE_APPLINK DSO_WIN32 NDEBUG OPENSSL_THREADS
>> OPENSSL_NO_STATIC_ENGINE OPENSSL_PIC OPENSSL_IA32_SSE2
>> OPENSSL_BN_ASM_MONT OPENSSL_BN_ASM_MONT5 OPENSSL_BN_ASM_GF2m SHA1_ASM
>> SHA256_ASM SHA512_ASM RC4_ASM MD5_ASM AES_ASM VPAES_ASM BSAES_ASM
>> GHASH_ASM ECP_NISTZ256_ASM POLY1305_ASM
>> LFLAG =/nologo /debug
>> PLIB_LFLAG=
>> EX_LIBS   =ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib
>> APPS_OBJ  =win32_init.o ../ms/applink.o
>> CPUID_OBJ =x86_64cpuid.o
>> UPLINK_OBJ=../ms/uplink.o uplink-x86_64.o
>> BN_ASM=bn_asm.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o
>> rsaz_exp.o rsaz-x86_64.o rsaz-avx2.o
>> EC_ASM=ecp_nistz256.o ecp_nistz256-x86_64.o
>> DES_ENC   =des_enc.o fcrypt_b.o
>> AES_ENC   =aes-x86

Re: [openssl-users] Build problems on Windows

2017-01-10 Thread jeff saremi
D:\repos\openssl2\openssl-1.1.0c>perl -v

This is perl 5, version 22, subversion 1 (v5.22.1) built for 
x86_64-msys-thread-multi
Copyright 1987-2015, Larry Wall




From: openssl-users <openssl-users-boun...@openssl.org> on behalf of Jakob Bohm 
<jb-open...@wisemo.com>
Sent: Monday, January 9, 2017 9:46 PM
To: openssl-users@openssl.org
Subject: Re: [openssl-users] Build problems on Windows

On 10/01/2017 05:04, jeff saremi wrote:
>
> Hello
>
> I downloaded openssl-1.1.0c and i'm trying to build this on Windows 10
> using Visual Studio 2015. I'm following the INSTALL and NOTES.WIN
> instructions however I get stopped rather quickly with file not found
> issues..
>
> I have also installed nasm. The build fails for 32 or 64 with slightly
> different paths in the error. Here's the sequence of commands:
> 1.perl Configure VC-WIN32
> 2.nmake
>
>
> output:
>
> D:\repos\openssl-1.1.0c>perl Configure VC-WIN64A
> Configuring OpenSSL version 1.1.0c (0x1010003fL)
> no-asan [default]  OPENSSL_NO_ASAN
> no-crypto-mdebug [default]  OPENSSL_NO_CRYPTO_MDEBUG
> no-crypto-mdebug-backtrace [default]
> OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
> no-ec_nistp_64_gcc_128 [default] OPENSSL_NO_EC_NISTP_64_GCC_128
> no-egd  [default]  OPENSSL_NO_EGD
> no-fuzz-afl [default]  OPENSSL_NO_FUZZ_AFL
> no-fuzz-libfuzzer [default]  OPENSSL_NO_FUZZ_LIBFUZZER
> no-heartbeats   [default]  OPENSSL_NO_HEARTBEATS
> no-md2  [default]  OPENSSL_NO_MD2 (skip dir)
> no-msan [default]  OPENSSL_NO_MSAN
> no-rc5  [default]  OPENSSL_NO_RC5 (skip dir)
> no-sctp [default]  OPENSSL_NO_SCTP
> no-ssl-trace[default]  OPENSSL_NO_SSL_TRACE
> no-ssl3 [default]  OPENSSL_NO_SSL3
> no-ssl3-method  [default]  OPENSSL_NO_SSL3_METHOD
> no-ubsan[default]  OPENSSL_NO_UBSAN
> no-unit-test[default]  OPENSSL_NO_UNIT_TEST
> no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS
> no-zlib [default]
> no-zlib-dynamic [default]
> Configuring for VC-WIN64A
> CC=cl
> CFLAG =-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32
> -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -DUNICODE
> -D_UNICODE /MD /O2
> SHARED_CFLAG  =
> DEFINES   =OPENSSL_USE_APPLINK DSO_WIN32 NDEBUG OPENSSL_THREADS
> OPENSSL_NO_STATIC_ENGINE OPENSSL_PIC OPENSSL_IA32_SSE2
> OPENSSL_BN_ASM_MONT OPENSSL_BN_ASM_MONT5 OPENSSL_BN_ASM_GF2m SHA1_ASM
> SHA256_ASM SHA512_ASM RC4_ASM MD5_ASM AES_ASM VPAES_ASM BSAES_ASM
> GHASH_ASM ECP_NISTZ256_ASM POLY1305_ASM
> LFLAG =/nologo /debug
> PLIB_LFLAG=
> EX_LIBS   =ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib
> APPS_OBJ  =win32_init.o ../ms/applink.o
> CPUID_OBJ =x86_64cpuid.o
> UPLINK_OBJ=../ms/uplink.o uplink-x86_64.o
> BN_ASM=bn_asm.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o
> rsaz_exp.o rsaz-x86_64.o rsaz-avx2.o
> EC_ASM=ecp_nistz256.o ecp_nistz256-x86_64.o
> DES_ENC   =des_enc.o fcrypt_b.o
> AES_ENC   =aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o
> aesni-x86_64.o aesni-sha1-x86_64.o aesni-sha256-x86_64.o aesni-mb-x86_64.o
> BF_ENC=bf_enc.o
> CAST_ENC  =c_enc.o
> RC4_ENC   =rc4-x86_64.o rc4-md5-x86_64.o
> RC5_ENC   =rc5_enc.o
> MD5_OBJ_ASM   =md5-x86_64.o
> SHA1_OBJ_ASM  =sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
> sha1-mb-x86_64.o sha256-mb-x86_64.o
> RMD160_OBJ_ASM=
> CMLL_ENC  =cmll-x86_64.o cmll_misc.o
> MODES_OBJ =ghash-x86_64.o aesni-gcm-x86_64.o
> PADLOCK_OBJ   =e_padlock-x86_64.o
> CHACHA_ENC=chacha-x86_64.o
> POLY1305_OBJ  =poly1305-x86_64.o
> BLAKE2_OBJ=
> PROCESSOR =
> RANLIB=true
> ARFLAGS   =/nologo
> PERL  =perl
>
> SIXTY_FOUR_BIT mode
>
> Configured for VC-WIN64A.
>
> D:\repos\openssl-1.1.0c>nmake
>
> Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
> "perl" "-I." -Mconfigdata "util/dofile.pl" "-omakefile"
> "crypto/include/internal/bn_conf.h.in" > crypto/include/internal/bn_conf.h
> "perl" "-I." -Mconfigdata "util/dofile.pl" "-omakefile"
> "crypto/include/internal/dso_conf.h.in" >
> crypto/include/internal/dso_conf.h
> "perl" "-I." -Mconfigdata "util/dofile.pl" "-omakefile"
> "include/openssl/opensslconf.h.in" > include/openssl/opensslconf.h
> set ASM=nasm
> "perl" "crypto/aes/asm/aes-x86_64.pl" 

[openssl-users] Build problems on Windows

2017-01-09 Thread jeff saremi
Hello

I downloaded openssl-1.1.0c and i'm trying to build this on Windows 10 using 
Visual Studio 2015. I'm following the INSTALL and NOTES.WIN instructions 
however I get stopped rather quickly with file not found issues..

I have also installed nasm. The build fails for 32 or 64 with slightly 
different paths in the error. Here's the sequence of commands:
1.perl Configure VC-WIN32
2.nmake


output:

D:\repos\openssl-1.1.0c>perl Configure VC-WIN64A
Configuring OpenSSL version 1.1.0c (0x1010003fL)
no-asan [default]  OPENSSL_NO_ASAN
no-crypto-mdebug [default]  OPENSSL_NO_CRYPTO_MDEBUG
no-crypto-mdebug-backtrace [default]  OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128
no-egd  [default]  OPENSSL_NO_EGD
no-fuzz-afl [default]  OPENSSL_NO_FUZZ_AFL
no-fuzz-libfuzzer [default]  OPENSSL_NO_FUZZ_LIBFUZZER
no-heartbeats   [default]  OPENSSL_NO_HEARTBEATS
no-md2  [default]  OPENSSL_NO_MD2 (skip dir)
no-msan [default]  OPENSSL_NO_MSAN
no-rc5  [default]  OPENSSL_NO_RC5 (skip dir)
no-sctp [default]  OPENSSL_NO_SCTP
no-ssl-trace[default]  OPENSSL_NO_SSL_TRACE
no-ssl3 [default]  OPENSSL_NO_SSL3
no-ssl3-method  [default]  OPENSSL_NO_SSL3_METHOD
no-ubsan[default]  OPENSSL_NO_UBSAN
no-unit-test[default]  OPENSSL_NO_UNIT_TEST
no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS
no-zlib [default]
no-zlib-dynamic [default]
Configuring for VC-WIN64A
CC=cl
CFLAG =-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 
-DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -DUNICODE 
-D_UNICODE /MD /O2
SHARED_CFLAG  =
DEFINES   =OPENSSL_USE_APPLINK DSO_WIN32 NDEBUG OPENSSL_THREADS 
OPENSSL_NO_STATIC_ENGINE OPENSSL_PIC OPENSSL_IA32_SSE2 OPENSSL_BN_ASM_MONT 
OPENSSL_BN_ASM_MONT5 OPENSSL_BN_ASM_GF2m SHA1_ASM SHA256_ASM SHA512_ASM RC4_ASM 
MD5_ASM AES_ASM VPAES_ASM BSAES_ASM GHASH_ASM ECP_NISTZ256_ASM POLY1305_ASM
LFLAG =/nologo /debug
PLIB_LFLAG=
EX_LIBS   =ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib
APPS_OBJ  =win32_init.o ../ms/applink.o
CPUID_OBJ =x86_64cpuid.o
UPLINK_OBJ=../ms/uplink.o uplink-x86_64.o
BN_ASM=bn_asm.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o rsaz_exp.o 
rsaz-x86_64.o rsaz-avx2.o
EC_ASM=ecp_nistz256.o ecp_nistz256-x86_64.o
DES_ENC   =des_enc.o fcrypt_b.o
AES_ENC   =aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o 
aesni-sha1-x86_64.o aesni-sha256-x86_64.o aesni-mb-x86_64.o
BF_ENC=bf_enc.o
CAST_ENC  =c_enc.o
RC4_ENC   =rc4-x86_64.o rc4-md5-x86_64.o
RC5_ENC   =rc5_enc.o
MD5_OBJ_ASM   =md5-x86_64.o
SHA1_OBJ_ASM  =sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o sha1-mb-x86_64.o 
sha256-mb-x86_64.o
RMD160_OBJ_ASM=
CMLL_ENC  =cmll-x86_64.o cmll_misc.o
MODES_OBJ =ghash-x86_64.o aesni-gcm-x86_64.o
PADLOCK_OBJ   =e_padlock-x86_64.o
CHACHA_ENC=chacha-x86_64.o
POLY1305_OBJ  =poly1305-x86_64.o
BLAKE2_OBJ=
PROCESSOR =
RANLIB=true
ARFLAGS   =/nologo
PERL  =perl

SIXTY_FOUR_BIT mode

Configured for VC-WIN64A.

D:\repos\openssl-1.1.0c>nmake

Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

"perl" "-I." -Mconfigdata "util/dofile.pl"  "-omakefile" 
"crypto/include/internal/bn_conf.h.in" > crypto/include/internal/bn_conf.h
"perl" "-I." -Mconfigdata "util/dofile.pl"  "-omakefile" 
"crypto/include/internal/dso_conf.h.in" > crypto/include/internal/dso_conf.h
"perl" "-I." -Mconfigdata "util/dofile.pl"  "-omakefile" 
"include/openssl/opensslconf.h.in" > include/openssl/opensslconf.h
set ASM=nasm
"perl" "crypto/aes/asm/aes-x86_64.pl" "auto" crypto/aes/aes-x86_64.asm

nasm -f win64 -DNEAR -Ox -g -ocrypto/aes/aes-x86_64.obj 
"crypto/aes/aes-x86_64.asm"
nasm: fatal: unable to open input file `crypto/aes/aes-x86_64.asm'
NMAKE : fatal error U1077: 'C:\nasm-2.12.02\nasm.EXE' : return code '0x1'
Stop.



-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] OpenSSL 1.0.2h reports speed test results as 0 secs and Infk ops/sec

2016-11-29 Thread Jeff Wieland

Dennis Clarke wrote:



Have you tried running Oracle's builds of OpenSSL?  They do the same
thing on the UltraSPARC 2e:


This is officially a bug. I'll file it and start looking into this one.

Very odd.

I will try this on a few other RISC architectures and see what I see. 
Starting with Power6.


Dennis


It's been a while for this :-).

I'm thinking that this is a Solaris bug.  Have you opened a ticket with 
Oracle about it?
I just patched one of my UltraSPARC 2e systems with the latest patches, 
and the problem

remains.

It's still easy to demonstrate:

On UltraSPARC 3i:

$ /bin/time tar cf /dev/null /opt/solstudio12.2

real   48.7
user0.5
sys 4.4

On UltraSPARC 2e:

$ /bin/time tar cf /dev/null /opt/solstudio12.2

real 1:08.1
user0.0
sys 0.0

On the UltraSPARC 2e (in this case a Sun Blade 150), the user and sys
times shouldn't be 0.0.

--
Jeff Wieland, UNIX/Network Systems Administrator
Purdue University IT Infrastructure Services UNIX Platforms


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] OpenSSL 1.0.2h reports speed test results as 0 secs and Infk ops/sec

2016-09-12 Thread Jeff Wieland

Dennis Clarke wrote:





I do build with the no-asm option, and I'm seeing the problem.

I'm suspicious that somehow the compiler optimization is generating code
that doesn't work quite right on the UltraSPARC 2e.


I have seen this a few times now so I also felt, hrmmm, something not 
quite right happening on these old slow netra boxes. Which, by the 
way, make great indestructible DNS servers.


In any case I changed the CFLAGS for the solaris64-sparcv9-cc option in
Configure thus :


"solaris64-sparcv9-cc","cc:

-m64 -xtarget=ultra2e -xarch=sparcvis -xchip=ultra2e -xcache=generic
-errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff
-xmemalign=8s -xnolibmil -Xa -xcode=pic32 -xregs=no%appl -xlibmieee
-mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf
-xunroll=1 -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS
-D_LARGEFILE64_SOURCE -D_REENTRANT -xdepend -DB_ENDIAN

::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:

BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL 
BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:

-KPIC:-m64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",


So the objective was to correct the wrong -xarch flag that has been in 
there for ages and also to get a full debug version which would be 
easy to single step through.


So that works fine.

So what I will look for is where the time calc is done, single step 
through that and find out why we get a 0.00sec time.


Dennis
I get the same results compiling with Oracle's build of gcc in 
/usr/sfw/bin (which uses
the Solaris assembler, etc.) and my own build of gcc 3.4.6 (which uses 
the GNU

assembler, etc.).

Have you tried running Oracle's builds of OpenSSL?  They do the same 
thing on the

UltraSPARC 2e:

$ /usr/bin/openssl version;/usr/bin/openssl speed
OpenSSL 1.0.1t  3 May 2016
Doing md2 for 3s on 16 size blocks: 140755 md2's in 0.00s
Doing md2 for 3s on 64 size blocks: 73864 md2's in 0.00s
Doing md2 for 3s on 256 size blocks: 25778 md2's in 0.00s
Doing md2 for 3s on 1024 size blocks: 6695 md2's in 0.00s
...

$ /usr/sfw/bin/openssl version;/usr/sfw/bin/openssl>
OpenSSL 0.9.7d 17 Mar 2004 (+ security fixes for: CVE-2005-2969 
CVE-2006-2937 CVE-2006-2940 CVE-2006-3738 CVE-2006-4339 CVE-2006-4343 
CVE-2006-7250 CVE-2007-5135 CVE-2007-3108 CVE-2008-5077 CVE-2008-7270 
CVE-2009-0590 CVE-2009-2409 CVE-2009-3555 CVE-2010-4180 CVE-2011-4576 
CVE-2011-4619 CVE-2012-0884 CVE-2012-1165 CVE-2012-2110 CVE-2012-2131 
CVE-2012-2333 CVE-2013-0166 CVE-2013-0169 CVE-2014-0224 CVE-2014-3508 
CVE-2014-3511 CVE-2014-3566 CVE-2014-3567 CVE-2014-3568 CVE-2014-3569 
CVE-2014-3570 CVE-2014-8275 CVE-2015-0204 CVE-2015-0286 CVE-2015-0287 
CVE-2015-0288 CVE-2015-0289 CVE-2015-0292 CVE-2015-0293 CVE-2015-1789 
CVE-2015-1790 CVE-2015-3195 CVE-2015-3197 CVE-2015-4000 CVE-2016-0703 
CVE-2016-0704 CVE-2016-0797 CVE-2016-0799 CVE-2016-0800 CVE-2016-2105 
CVE-2016-2106 CVE-2016-2107 CVE-2016-2108 CVE-2016-2176)

Doing md2 for 3s on 16 size blocks: 79067 md2's in 0.00s
Doing md2 for 3s on 64 size blocks: 42773 md2's in 0.00s
Doing md2 for 3s on 256 size blocks: 15316 md2's in 0.00s
Doing md2 for 3s on 1024 size blocks: 4240 md2's in 0.00s
Doing md2 for 3s on 8192 size blocks: 543 md2's in 0.00s
...


They appear to work fine on the other SPARC machines that I can get test 
it on.


--
Jeff Wieland, UNIX/Network Systems Administrator
Purdue University IT Infrastructure Services UNIX Platforms

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] OpenSSL 1.0.2h reports speed test results as 0 secs and Infk ops/sec

2016-09-12 Thread Jeff Wieland

Dennis Clarke wrote:

On 09/11/2016 03:44 PM, Jeff Wieland wrote:

I see the same thing on Sun Blade 150 (650Mhz), with OpenSSL 1.0.2h
compiled with Studio 12.2 -- and with a Sun Fire V100 (550Mhz).

It works correctly on a Sun Fire V240 (1.5Ghz), a Sun Ultra 10 (440Mhz),
a Sun Fire T1000, and Sun Enterprise M3000.

I see these results with both 32 bit and 64 bit builds.

It looks like you're building and running this on an UltraSPARC 2e
architecture system -- this is what the SB150 and the V100 are.


Hrmmm .. not sure what that means. Given that I run Configure with the
"no-asm" option then I would think that cross platform consistency
would happen. I would have to go diving into the source to find out
where the timings are happening. On Solaris the best timer is the
gethrtime() function as it works down to the nanosec and is accurate to
the millisec at least.

Dennis



I do build with the no-asm option, and I'm seeing the problem.

I'm suspicious that somehow the compiler optimization is generating code 
that doesn't work

quite right on the UltraSPARC 2e.

--
Jeff Wieland, UNIX/Network Systems Administrator
Purdue University IT Infrastructure Services UNIX Platforms

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] OpenSSL 1.0.2h reports speed test results as 0 secs and Infk ops/sec

2016-09-11 Thread Jeff Wieland

I see the same thing on Sun Blade 150 (650Mhz), with OpenSSL 1.0.2h
compiled with Studio 12.2 -- and with a Sun Fire V100 (550Mhz).

It works correctly on a Sun Fire V240 (1.5Ghz), a Sun Ultra 10 (440Mhz),
a Sun Fire T1000, and Sun Enterprise M3000.

I see these results with both 32 bit and 64 bit builds.

It looks like you're building and running this on an UltraSPARC 2e
architecture system -- this is what the SB150 and the V100 are.

--
Jeff Wieland, UNIX/Network Systems Administrator
Purdue University IT Infrastructure Services UNIX Platforms

Dennis Clarke wrote:


Strange results from OpenSSL 1.0.2h built on an older sparc server 
with Oracle Studio 12.4 and with ALL testsuite tests passed :


mimas$ openssl version
OpenSSL 1.0.2h  3 May 2016

mimas$ openssl speed
Doing mdc2 for 3s on 16 size blocks: 30887 mdc2's in 0.00s
Doing mdc2 for 3s on 64 size blocks: 8500 mdc2's in 0.00s
Doing mdc2 for 3s on 256 size blocks: 1858 mdc2's in 0.00s
Doing mdc2 for 3s on 1024 size blocks: 549 mdc2's in 0.00s
Doing mdc2 for 3s on 8192 size blocks: 69 mdc2's in 0.00s
Doing md4 for 3s on 16 size blocks: 127674 md4's in 0.00s
Doing md4 for 3s on 64 size blocks: 99595 md4's in 0.00s
Doing md4 for 3s on 256 size blocks: 59892 md4's in 0.00s
.
.  etc etc
.
Doing 163 bit  ecdh's for 10s: 193 163-bit ECDH ops in 0.00s
Doing 233 bit  ecdh's for 10s: 94 233-bit ECDH ops in 0.00s
Doing 283 bit  ecdh's for 10s: 52 283-bit ECDH ops in 0.00s
Doing 409 bit  ecdh's for 10s: 22 409-bit ECDH ops in 0.00s
Doing 571 bit  ecdh's for 10s: 9 571-bit ECDH ops in 0.00s
OpenSSL 1.0.2h  3 May 2016
built on: reproducible build, date unspecified
options:bn(64,32) rc4(ptr,char) des(ptr,risc1,16,int) aes(partial) 
idea(int) blowfish(ptr)
compiler: /opt/solarisstudio12.4/bin/cc -I. -I.. -I../include -KPIC 
-DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN 
-DHAVE_DLFCN_H -m64 -xtarget=ultra2e -xarch=sparcvis -xchip=ultra2e 
-xcache=generic -errfmt=error -erroff=%none -errshort=full -xstrconst 
-xildoff -m64 -xmemalign=8s -xnolibmil -Xa -xcode=pic32 -xregs=no%appl 
-xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none 
-xdebugformat=dwarf -xunroll=1 -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS 
-D_LARGEFILE64_SOURCE -D_REENTRANT -xdepend -DB_ENDIAN

The 'numbers' are in 1000s of bytes per second processed.
type   16 bytes 64 bytes256 bytes   1024 bytes   8192 bytes
md20.00 0.00 0.00 0.00 0.00
mdc2Infk Infk Infk Infk Infk
md4 Infk Infk Infk Infk Infk
md5 Infk Infk Infk Infk Infk
.
.
.
ghash   Infk Infk Infk Infk Infk
  signverifysign/s verify/s
rsa  512 bits 0.00s 0.00s  Inf  Inf
rsa 1024 bits 0.00s 0.00s  Inf  Inf
rsa 2048 bits 0.00s 0.00s  Inf  Inf
rsa 4096 bits 0.00s 0.00s  Inf  Inf
  signverifysign/s verify/s
dsa  512 bits 0.00s 0.00s  Inf  Inf
dsa 1024 bits 0.00s 0.00s  Inf  Inf
dsa 2048 bits 0.00s 0.00s  Inf  Inf
  signverifysign/s verify/s
 160 bit ecdsa (secp160r1)   0.s   0.s  Inf  Inf
 192 bit ecdsa (nistp192)   0.s   0.s  Inf  Inf
 224 bit ecdsa (nistp224)   0.s   0.s  Inf  Inf
 256 bit ecdsa (nistp256)   0.s   0.s  Inf  Inf
 384 bit ecdsa (nistp384)   0.s   0.s  Inf  Inf
 521 bit ecdsa (nistp521)   0.s   0.s  Inf  Inf
 163 bit ecdsa (nistk163)   0.s   0.s  Inf  Inf
 233 bit ecdsa (nistk233)   0.s   0.s  Inf  Inf
 283 bit ecdsa (nistk283)   0.s   0.s  Inf  Inf
 409 bit ecdsa (nistk409)   0.s   0.s  Inf  Inf
 571 bit ecdsa (nistk571)   0.s   0.s  Inf  Inf
 163 bit ecdsa (nistb163)   0.s   0.s  Inf  Inf
 233 bit ecdsa (nistb233)   0.s   0.s  Inf  Inf
 283 bit ecdsa (nistb283)   0.s   0.s  Inf  Inf
 409 bit ecdsa (nistb409)   0.s   0.s  Inf  Inf
 571 bit ecdsa (nistb571)   0.s   0.s  Inf  Inf
  op  op/s
 160 bit ecdh (secp160r1)   0.s  Inf
 192 bit ecdh (nistp192)   0.s  Inf
 224 bit ecdh (nistp224)   0.s  Inf
 256 bit ecdh (nistp256)   0.s  Inf
 384 bit ecdh (nistp384)   0.s  Inf
 521 bit ecdh (nistp521)   0.s  Inf
 163 bit ecdh (nistk163)   0.s  Inf
 233 bit ecdh (nistk233)   0.s  Inf
 283 bit ecdh (nistk283)   0.s  Inf
 409 bit ecdh (nistk409)   0.s  Inf
 571 bit ecdh (nistk571)   0.s  Inf
 163 bit ecdh (nistb163)   0.s  Inf
 233 bit ecdh (nistb233)   0.s  Inf
 283 bit ecdh (nistb283)   0.s  Inf
 409 bit ecdh (nistb409)   0.s  Inf
 571 bit ecdh (nistb571)   0.s  Inf

[openssl-users] libssl.so.1.0.0

2016-01-12 Thread Jeff Archer
I am building from source that came from openssl-1.0.2e.tar.gz but it
appears to be producing output of libssl.so.1.0.0.  Is this what I should
expect?


Jeff Archer
jeffarch...@gmail.com <jarch...@yahoo.com>
___
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: OpenSSL Security Advisory

2014-06-06 Thread Jeff Wieland
Reported by Yuval Yarom and Naomi Benger.  This issue was previously
fixed in OpenSSL 1.0.1g.


References
==

URL for this Security Advisory:
http://www.openssl.org/news/secadv_20140605.txt

Note: the online version of the advisory may be updated with additional
details over time.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJTkFm3AAoJENNXdQf6QOnihZAQAIFx8gw6s6HabFQ1b+GIpvdi
aJ1BBE4RPVLvxVtApON0eOESjcuetkiz6aU2JUVeObWn9fiPjuRnNueuFe5CiK0P
zVzv1AFyfae0m5IMzGSPgmffusbTo8cfjt6N6e77p6zWFncmlTW1wkr3th3RdjBk
OyEZgrSq1lO22csiQVD/CG+sOFWJUxM1dDDzluVU+XCnNEFdfAKc/i6b26BLUjag
zIDbptPgDu/5alRGqO/1A1EC0ODLYtu0xJWe7JUMPSPa/M8y2U9AKAMGPvlxJzs1
g2rNk14NT1YzN7KJBHJVMA70wMSmsU0jq3IYcXMUrhOkuBTAIKYb/KaivYS15Wrm
LJWJJzC1uIuaJOnUhN9g0Q5WwVkQTwf0oY/n+qdhyup/9duJvuWpgSK4cW8c7xGe
t7bYaOMlTjPKrUmulXDi0GBdcGd/UwctCWdaDeHORVlz7WM+aQHQfQMAaNmpzJzV
/CA5h5t4OlrjLLJW/Im5axk7Li8HU8aypkhLLCZUNjkLmoYnl1buo4LmmikQ77A2
JyoSlioYWC+lry22VQien/JR4ute7DO+s9N0jcWMTjR/isTwwnehimpf8Pyc/MoQ
kvKh+vXIVBX+u0jufSB4E2fDCgcr95bjjlQwnMTLhcDn1y1X39qU2LjXDdJIwwVw
oAC+cB8GKalIUtUfXf4x
=3foe
-END PGP SIGNATURE-
__
OpenSSL Project http://www.openssl.org
Announcement Mailing List openssl-annou...@openssl.org
Automated List Manager   majord...@openssl.org




--
  Jeff Wieland| Purdue University
   Network Systems Administrator  |ITIS UNIX Platforms
   Voice: (765)496-8234   |155 S. Grant Street
FAX: (765)494-2253|  West Lafayette, IN 47907

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: OpenSSL Security Advisory

2014-06-05 Thread Jeff Wieland
 Yarom and Naomi Benger.  This issue was previously
fixed in OpenSSL 1.0.1g.


References
==

URL for this Security Advisory:
http://www.openssl.org/news/secadv_20140605.txt

Note: the online version of the advisory may be updated with additional
details over time.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJTkFm3AAoJENNXdQf6QOnihZAQAIFx8gw6s6HabFQ1b+GIpvdi
aJ1BBE4RPVLvxVtApON0eOESjcuetkiz6aU2JUVeObWn9fiPjuRnNueuFe5CiK0P
zVzv1AFyfae0m5IMzGSPgmffusbTo8cfjt6N6e77p6zWFncmlTW1wkr3th3RdjBk
OyEZgrSq1lO22csiQVD/CG+sOFWJUxM1dDDzluVU+XCnNEFdfAKc/i6b26BLUjag
zIDbptPgDu/5alRGqO/1A1EC0ODLYtu0xJWe7JUMPSPa/M8y2U9AKAMGPvlxJzs1
g2rNk14NT1YzN7KJBHJVMA70wMSmsU0jq3IYcXMUrhOkuBTAIKYb/KaivYS15Wrm
LJWJJzC1uIuaJOnUhN9g0Q5WwVkQTwf0oY/n+qdhyup/9duJvuWpgSK4cW8c7xGe
t7bYaOMlTjPKrUmulXDi0GBdcGd/UwctCWdaDeHORVlz7WM+aQHQfQMAaNmpzJzV
/CA5h5t4OlrjLLJW/Im5axk7Li8HU8aypkhLLCZUNjkLmoYnl1buo4LmmikQ77A2
JyoSlioYWC+lry22VQien/JR4ute7DO+s9N0jcWMTjR/isTwwnehimpf8Pyc/MoQ
kvKh+vXIVBX+u0jufSB4E2fDCgcr95bjjlQwnMTLhcDn1y1X39qU2LjXDdJIwwVw
oAC+cB8GKalIUtUfXf4x
=3foe
-END PGP SIGNATURE-
__
OpenSSL Project http://www.openssl.org
Announcement Mailing List openssl-annou...@openssl.org
Automated List Manager   majord...@openssl.org




--
  Jeff Wieland| Purdue University
   Network Systems Administrator  |ITIS UNIX Platforms
   Voice: (765)496-8234   |155 S. Grant Street
FAX: (765)494-2253|  West Lafayette, IN 47907
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Is it possible that calling ssl_accept in multi-threading circumstance will result in app to crash?

2014-04-14 Thread 2234822 jeff
In my code, the server thread listen for incoming connection request, when
there is a new request, it spawns a new client thread to handle the
request. Does it need synchronization between multiple client threads by
following the way pointed out here
https://www.openssl.org/support/faq.html#PROG1? Is there a possibility that
some OpenSSL structures are being shared between the threads, right?


2014-03-26 17:37 GMT+08:00 Bodo Moeller bmoel...@acm.org:

 jeff jeff.2234...@gmail.com:

 I keep getting some application crash in openssl module, I checked the
 dumps and stacks and found that although the stacks vary, the ssl_accept
 function is found on all of them, below are some of exmaples. I google the
 related information about this, looks like there is some problem when
 calling ssl_accept under multi-thread circumstance. My question is, is it
 possible that calling ssl_accept in multi-threading circumstance will
 result in app to crash?


 Yes -- a single SSL object can't be used concurrently by multiple threads;
 see https://www.openssl.org/support/faq.html#PROG1.

 Bodo




Is it possible that calling ssl_accept in multi-threading circumstance will result in app to crash?

2014-03-26 Thread 2234822 jeff
Dear users,

I keep getting some application crash in openssl module, I checked the
dumps and stacks and found that although the stacks vary, the ssl_accept
function is found on all of them, below are some of exmaples. I google the
related information about this, looks like there is some problem when
calling ssl_accept under multi-thread circumstance. My question is, is it
possible that calling ssl_accept in multi-threading circumstance will
result in app to crash?


--
OpenSSL version, extracted from the README file

OpenSSL 1.0.1 14 Mar 2012

-
OS version and platform:

Windows Server 2008 R2 Enterprise Edition 6.1 SP 1.


0:014 kb
ChildEBP RetAddr  Args to Child
01fbdeb0 769dc752 0002 01fbe06c 0001
ntdll!NtWaitForMultipleObjects+0xc
01fbe034 74fe564b 0002  
KERNELBASE!WaitForMultipleObjectsEx+0x10b
01fbe0a8 74fe57f5 01fbe194 01fbe194 
kernel32!WerpReportFaultInternal+0x1c4
01fbe0bc 74fb780f 01fbe194 01fbe164 76a608dc kernel32!WerpReportFault+0x6d
01fbe0c8 76a608dc 01fbe194 0001 d4795733 kernel32!BasepReportFault+0x19
01fbe164 7743bf2c 01fbe194 774030b4 fffe
KERNELBASE!UnhandledExceptionFilter+0x1f1
01fbe16c 774030b4 fffe 7740e728 01fbffd4 ntdll!__RtlUserThreadStart+0x57
01fbe180 773c5246    ntdll!_EH4_CallFilterFunc+0x12
01fbe1a8 773c51b1 774ae1e0 773ef810 
ntdll!_except_handler4_common+0x8e
01fbe1c8 77402e71 01fbe2cc 01fbffc4 01fbe31c ntdll!_except_handler4+0x20
01fbe1ec 77402e43 01fbe2cc 01fbffc4 01fbe31c ntdll!ExecuteHandler2+0x26
01fbe2b4 77402cbb 01fbe2cc 01fbe31c 01fbe2cc ntdll!ExecuteHandler+0x24
01fbe2b4 004f105b 01fbe2cc 01fbe31c 01fbe2cc
ntdll!KiUserExceptionDispatcher+0xf
01fbe784 004f12c3  02f51ad8 00572538
libeay32!asn1_item_combine_free+0x1b
01fbe798 004f11c0 0008 00572498 02f51ad8
libeay32!ASN1_template_free+0x93
01fbe7bc 004f12c3  01fbe80c 005725a8
libeay32!asn1_item_combine_free+0x180
01fbe7d0 004f11c0 02f51ad8 0057256c 01fbe80c
libeay32!ASN1_template_free+0x93
01fbe7f4 004f12e1  007b 02b53338
libeay32!asn1_item_combine_free+0x180
01fbe804 004ed97f 02f51ad8 005725a8 003d6628 libeay32!ASN1_item_free+0x11
01fbe810 003d6628 02f51ad8 02b53338 003d7121 libeay32!X509_free+0xf
01fbe81c 003d7121 02b53338 0001 003d713e ssleay32!SSL_SESSION_free+0x88
01fbe828 003d713e 02b8d328 004d4ec3 02b53338 ssleay32!timeout_doall_arg+0x51
01fbe830 004d4ec3 02b53338 01fbe888 0100
ssleay32!timeout_LHASH_DOALL_ARG+0xe
01fbe848 004d4f4c 00fbeea0  003d7130 libeay32!doall_util_fn+0x33
01fbe860 003d719a 00fbeea0 003d7130 01fbe888 libeay32!lh_doall_arg+0x1c
01fbe890 003d3a65 01681048 53069705 
ssleay32!SSL_CTX_flush_sessions+0x5a
01fbe8b8 003b93a0 02d719f8 0002 77230b8a ssleay32!ssl_update_cache+0xe5
01fbe8e4 003d557d 0003 0002 00407c29 ssleay32!ssl3_accept+0x950
01fbe8f0 00407c29 02d719f8 a298a10e 02ae8830 ssleay32!SSL_accept+0x1d
...

0:015 kb
ChildEBP RetAddr  Args to Child
02ceddf8 76cec752 0002 02cedfb4 0001
ntdll!NtWaitForMultipleObjects+0xc
02cedf7c 7690564b 0002  
KERNELBASE!WaitForMultipleObjectsEx+0x10b
02cedff0 769057f5 02cee0dc 02cee0dc 
kernel32!WerpReportFaultInternal+0x1c4
02cee004 768d780f 02cee0dc 02cee0ac 76d708dc kernel32!WerpReportFault+0x6d
02cee010 76d708dc 02cee0dc 0001 c33b8f5c kernel32!BasepReportFault+0x19
02cee0ac 7775bf2c 02cee0dc 777230b4 fffe
KERNELBASE!UnhandledExceptionFilter+0x1f1
02cee0b4 777230b4 fffe 7772e728 02ceffd4 ntdll!__RtlUserThreadStart+0x57
02cee0c8 776e5246    ntdll!_EH4_CallFilterFunc+0x12
02cee0f0 776e51b1 777ce1e0 7770f810 
ntdll!_except_handler4_common+0x8e
02cee110 77722e71 02cee214 02ceffc4 02cee264 ntdll!_except_handler4+0x20
02cee134 77722e43 02cee214 02ceffc4 02cee264 ntdll!ExecuteHandler2+0x26
02cee1fc 77722cbb 02cee214 02cee264 02cee214 ntdll!ExecuteHandler+0x24
02cee1fc 77731c10 02cee214 02cee264 02cee214
ntdll!KiUserExceptionDispatcher+0xf
02cee6d8 7773521c 00f1 1668b140 0e00
ntdll!RtlpHeapFreeListCompare+0x12
02cee6f8 77731c77 00f1 077f 77731bfe
ntdll!RtlpHeapFindListLookupEntry+0x74
02cee720 77735cc1 00f1 0e00 0258a000 ntdll!RtlpFindEntry+0x49
02cee748 776ff85b 00f1 0400 0e00 ntdll!RtlpInsertFreeBlock+0x17d
02cee79c 7773b1db 00f1 0258a000 0e00
ntdll!RtlpDeCommitFreeBlock+0x9d
02cee824 77732664 0258a000 0258a008  ntdll!RtlpFreeHeap+0x219
02cee848 74b74c39 00f1  0258a008 ntdll!RtlFreeHeap+0x206
02cee894 004825bd 0258a008 013c9460 004bd045 msvcr80!free+0xcd
02cee8a0 004bd045 0258a008 0258a008  libeay32!CRYPTO_free+0x1d
02cee8b8 00379377 013c9460 02811908 74d60b8a libeay32!BUF_MEM_free+0x25
02cee8e4 0039557d 0003 0002 00407c29 ssleay32!ssl3_accept+0x927
02cee8f0 00407c29 02811908 b5ab33b8 024d80c0 ssleay32!SSL_accept+0x1d
...


Addition of TLS 1.2 client-side support causing failures to Windows servers

2014-01-17 Thread Jeff Franklin

Hello,

Our organization just switched some of our environments to using 
openssl-1.0.1e, and since doing so connections from those machines to our 
Windows servers fail where they used to succeed. I've done some 
investigation into openssl and I have the problem narrowed to the list of 
cipher suites offered in the client hello when TLS 1.2 is switched on. 
Specifically, if I do 'openssl s_client -no_tls1_2 ...' on the latest 
openssl-1.0.1f it will succeed, and fail otherwise. From a debugger I can 
set client_version to 1.1 during the function ssl_cipher_list_to_bytes and 
reset to 1.2 upon exit of that function and connection will again succeed.


Our Windows servers only go up to TLSv1, and the key indication of a 
failed connection is that openssl s_client will claim that 'Secure 
Renegotiation IS NOT supported'. However, if I use openssl-1.0.0k against 
the same server it will report that 'Secure Renegotiation IS supported'.


Does anyone have any idea what's going on? Can someone recommend some next 
steps I can try?


Thanks,

--
Jeff Franklin
Software Engineer, Identity and Access Management
UW Information Technology
University of Washington
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Hi, I need help with initialization of OpenSSL

2013-10-10 Thread Jeff Trawick
On Thu, Oct 10, 2013 at 11:50 AM, Angelin Lalev lalev.ange...@gmail.comwrote:

 Greetings,
 I could use some help.

 I'm getting segmentation fault from this code:

/* Init the openssl library */
 SSL_load_error_strings();
 SSL_library_init();

 ctx=SSL_CTX_new(SSLv3_client_method());

 The backtrace looks like this:

 Program received signal SIGSEGV, Segmentation fault.
 0x0086d1fc in read ()
 (gdb) backtrace
 #0  0x0086d1fc in read ()


Run info threads and see what the other threads are doing.  (thread n
followed by backtrace)  Presumably the crash is on another thread since
it is hard to make read() crash.



 #1  0x004eb3fe in RAND_poll () at rand_unix.c:347
 #2  0x004eabed in ssleay_rand_bytes (buf=0x88ed00 , num=16,
 pseudo=1)
 at md_rand.c:394
 #3  0x004eb0b0 in ssleay_rand_pseudo_bytes (buf=0x88ed00 ,
 num=16)
 at md_rand.c:543
 #4  0x0045d352 in RAND_pseudo_bytes (buf=0x88ed00 , num=16)
 at rand_lib.c:172
 #5  0x00424163 in SSL_CTX_new (meth=0x5c4200) at ssl_lib.c:1808
 #6  0x00402ca2 in main (argc=1, argv=0x7fffe718) at fing.c:253

 My system is Ubuntu Server LTS 12.10 and it's currently installed in a
 VirtualBox virtual machine.
 I'm not at all proficient in C, even more in Linux development and I
 cannot by myself determine what
 I did to break things. Up to one moment, the program was working, at
 the next recompilation/reboot it just
 stopped :-) I do a binary which will be located on initramfs system,
 so it is statically compiled.
 OpenSSL is compiled with the following config options

 ./config -d no-dso no-shared
 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   majord...@openssl.org




-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


Re: Hi, I need help with initialization of OpenSSL

2013-10-10 Thread Jeff Trawick
On Thu, Oct 10, 2013 at 12:54 PM, Angelin Lalev lalev.ange...@gmail.comwrote:

 (gdb) r
 Starting program: /home/ventsi/fing/fing

 Program received signal SIGSEGV, Segmentation fault.
 0x0086d1fc in read ()
 (gdb) info threads
   Id   Target Id Frame
 * 1process 13262 fing 0x0086d1fc in read ()


Ouch/I'll shut up now.

(I think there's something very basic going wrong/getting corrupted if a
segfault is reported in the syscall interface.)


 On Thu, Oct 10, 2013 at 7:19 PM, Jeff Trawick traw...@gmail.com wrote:
  On Thu, Oct 10, 2013 at 11:50 AM, Angelin Lalev lalev.ange...@gmail.com
 
  wrote:
 
  Greetings,
  I could use some help.
 
  I'm getting segmentation fault from this code:
 
 /* Init the openssl library */
  SSL_load_error_strings();
  SSL_library_init();
 
  ctx=SSL_CTX_new(SSLv3_client_method());
 
  The backtrace looks like this:
 
  Program received signal SIGSEGV, Segmentation fault.
  0x0086d1fc in read ()
  (gdb) backtrace
  #0  0x0086d1fc in read ()
 
 
  Run info threads and see what the other threads are doing.  (thread n
  followed by backtrace)  Presumably the crash is on another thread
 since it
  is hard to make read() crash.
 
 
 
  #1  0x004eb3fe in RAND_poll () at rand_unix.c:347
  #2  0x004eabed in ssleay_rand_bytes (buf=0x88ed00 , num=16,
  pseudo=1)
  at md_rand.c:394
  #3  0x004eb0b0 in ssleay_rand_pseudo_bytes (buf=0x88ed00 ,
  num=16)
  at md_rand.c:543
  #4  0x0045d352 in RAND_pseudo_bytes (buf=0x88ed00 , num=16)
  at rand_lib.c:172
  #5  0x00424163 in SSL_CTX_new (meth=0x5c4200) at ssl_lib.c:1808
  #6  0x00402ca2 in main (argc=1, argv=0x7fffe718) at
 fing.c:253
 
  My system is Ubuntu Server LTS 12.10 and it's currently installed in a
  VirtualBox virtual machine.
  I'm not at all proficient in C, even more in Linux development and I
  cannot by myself determine what
  I did to break things. Up to one moment, the program was working, at
  the next recompilation/reboot it just
  stopped :-) I do a binary which will be located on initramfs system,
  so it is statically compiled.
  OpenSSL is compiled with the following config options
 
  ./config -d no-dso no-shared
  __
  OpenSSL Project http://www.openssl.org
  User Support Mailing Listopenssl-users@openssl.org
  Automated List Manager   majord...@openssl.org
 
 
 
 
  --
  Born in Roswell... married an alien...
  http://emptyhammock.com/
 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   majord...@openssl.org




-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


Re: redirected input to s_client on Windows: Any trick to avoid the keypress?

2013-10-06 Thread Jeff Trawick
On Thu, Oct 3, 2013 at 5:32 PM, Ben Laurie b...@links.org wrote:




 On 3 October 2013 22:14, Jeff Trawick traw...@gmail.com wrote:

 E.g., run

 echo GET / | openssl s_client -connect host:port

 It does the handshake then stalls until you press a key (which will be
 left unused in the buffer when openssl exits), then it sends the input.  I
 guess the kbhit() in the s_client code is what is waking it up.

 I've played around with various command-line arguments but haven't found
 one to bypass the issue.

 (Windows Server 2008R2, openssl 1.0.1e bindist)


 I'm guessing this is a windows bug, since it works fine for me on FreeBSD.


Definitely (spaghetti in the preprocessor platform checks in s_client)...
I'll suggest a real patch for that soon-ish...





 --
 Born in Roswell... married an alien...
 http://emptyhammock.com/





-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


Re: redirected input to s_client on Windows: Any trick to avoid the keypress?

2013-10-04 Thread Jeff Trawick
On Fri, Oct 4, 2013 at 9:17 AM, Salz, Rich rs...@akamai.com wrote:

 When you run it interactively, does it work right away or do you need to
 hit TWO returns?


It works right away.

The keypresses trigger the read of stdin (since the
WaitForSingleObject(stdin) is bypassed due to the OPENSSL_SYS_MSDOS issue),
so there's no problem in interactive mode.



 

 ** **

 ** **

 --  

 Principal Security Engineer

 Akamai Technology

 Cambridge, MA




-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


redirected input to s_client on Windows: Any trick to avoid the keypress?

2013-10-03 Thread Jeff Trawick
E.g., run

echo GET / | openssl s_client -connect host:port

It does the handshake then stalls until you press a key (which will be left
unused in the buffer when openssl exits), then it sends the input.  I guess
the kbhit() in the s_client code is what is waking it up.

I've played around with various command-line arguments but haven't found
one to bypass the issue.

(Windows Server 2008R2, openssl 1.0.1e bindist)

-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


RE: openSSL 1.0.0g on hpux-11i

2012-03-05 Thread Jeff and Lita Pratt
I'll answer my own question in hopes of saving someone else some time some day.

The openssl self-test is apparently quite enthusiastic about using up entropy.
Starting egd with the --bottomless parameter allowed the openssl make test to 
proceed to completion.
This egd feature is mentioned in its README, in the section about usage with 
GPG.

JcP

The larger the island of knowledge,
the longer the shoreline of wonder.
-- R. W. Sockman

-Original Message-
From: owner-openssl-us...@openssl.org [mailto:owner-openssl-us...@openssl.org] 
On Behalf Of Jeff  Lita Pratt
Sent: Friday, March 02, 2012 2:10 PM
To: openssl-users@openssl.org
Subject: openSSL 1.0.0g on hpux-11i

I'm a newbe with openssl, trying to get it installed so I can build 
cURL libararies.

My system does not have /dev/random, etc, so I downloaded, built, and 
installed the egd daemon.  It appears to be running:

$ ll $HOME/.rnd
-rw---   1 jeff   lms   1024 Mar  2 12:30 
/home/jeff/.rnd

$ ll /etc/entropy
srwxrwxrwx   1 root   sys  0 Mar  2 11:05 /etc/entropy

I then ran configure, make, and make test in the openssl-1.0.0g 
directory.

The make test got a lot further this time (I'd tried it a few days ago 
before realizing I needed egd), but, alas, after awhile it emitted:

rsa
Setting up TSA test directory...
Creating CA for TSA tests...
Creating a new CA for the TSA tests...
unable to load 'random state'
This means that the random number generator has not been seeded
with much random data.
Generating a 1024 bit RSA private key
Error Generating Key
2063818456:error:24064064:random number 
generator:SSLEAY_RAND_BYTES:PRNG not see
ded:md_rand.c:522:You need to read the OpenSSL FAQ, 
http://www.openssl.org/suppo
rt/faq.html
2063818456:error:04081003:rsa routines:RSA_BUILTIN_KEYGEN:BN 
lib:rsa_gen.c:208:
TSA test failed!
*** Error exit code 1


What did I miss

Thanks in advance...

Jeff Pratt


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org




__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


openSSL 1.0.0g on hpux-11i

2012-03-02 Thread Jeff Lita Pratt
I'm a newbe with openssl, trying to get it installed so I can build 
cURL libararies.


My system does not have /dev/random, etc, so I downloaded, built, and 
installed the egd daemon.  It appears to be running:


$ ll $HOME/.rnd
-rw---   1 jeff   lms   1024 Mar  2 12:30 
/home/jeff/.rnd


$ ll /etc/entropy
srwxrwxrwx   1 root   sys  0 Mar  2 11:05 /etc/entropy

I then ran configure, make, and make test in the openssl-1.0.0g 
directory.


The make test got a lot further this time (I'd tried it a few days ago 
before realizing I needed egd), but, alas, after awhile it emitted:


rsa
Setting up TSA test directory...
Creating CA for TSA tests...
Creating a new CA for the TSA tests...
unable to load 'random state'
This means that the random number generator has not been seeded
with much random data.
Generating a 1024 bit RSA private key
Error Generating Key
2063818456:error:24064064:random number 
generator:SSLEAY_RAND_BYTES:PRNG not see
ded:md_rand.c:522:You need to read the OpenSSL FAQ, 
http://www.openssl.org/suppo

rt/faq.html
2063818456:error:04081003:rsa routines:RSA_BUILTIN_KEYGEN:BN 
lib:rsa_gen.c:208:

TSA test failed!
*** Error exit code 1


What did I miss

Thanks in advance...

Jeff Pratt


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Help Needed: SSL Connect starting from a weird state

2011-10-22 Thread Jeff Saremi
My initial analysis of this was very misleading. I have to apologize for
that.
The problem was that during the first part of the handshake
(clienthello), the call failed without anything being written out.
Tracing ssl23_client_hello() in s23_clnt.c showed that the following
statement returned false and as a result -1 was returned as the error.
if (RAND_pseudo_bytes(...) =0)
  return -1;

And for any instances of error for which an internal OpenSSL ERR is not
set, SSL_ERROR_SYSCALL is used, which is further misleading.

I did a cursory search of anywhere that a call to RAND_pseudo_bytes can
fail and there are tens of such instances for which OpenSSL ERR is not
set. In fact, there's only one instance of a call to RANDerr which is
inside md_rand.c. I guess this would be something for OpenSSL guys to
ponder.

Another strange thing is no matter how many times we ran the
application, the call always failed on the same spot; the same call to
RAND_pseudo_byes each time, not before or after. This was regardless of
how many successful calls were made prior to.

Jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Help Needed: SSL Connect starting from a weird state

2011-10-20 Thread Jeff Saremi
We've been running our SSL code for a while now with no issues. But
recently one of our developers started encountering this problem.
We did the best we could to troubleshoot to no avail. I know the 
problem is not OpenSSL and it's something we're doing incorrectly,
probably at the start up.

The problem:
SSL completed without having done a single send or receive during the
handshake.

What we get in the print out, after issuing SSL_connect() is this:

Printout:
18:13:56.925 [4228] connect
18:13:56.927 [4228] SSL nonblock rc:-1 shutdown:0 state:23WCHA
(from:UNKWN )
18:13:56.928 [4228] ssl_err:5 SSL_ERROR_SYSCALL

The rough version of the code printing the above is this:
printf(connect\n);
const char *fromState = SSL_state_string(mSsl);
rc = SSL_connect(mSsl);
printf(SSL nonblock rc:%d shutdown:%d state:%s (from:%s)\n,
rc,
SSL_get_shutdown(mSsl),
SSL_state_string(mSsl),
fromState);
int ssl_error = SSL_get_error(mSsl, rc);
switch(ssl_error)
{
case SSL_ERROR_SYSCALL:
  printf(%d SSL_ERROR_SYSCALL\n, SSL_ERROR_SYSCALL);
...


What I would expect to see would be something along the lines of the
following:

SSL nonblock rc:1 shutdown:0 state:SSLOK (from:UNKWN )

or
SSL nonblock rc:-1 shutdown:0 state:SSLOK (from:SSLOK )


For additional debugging I have enabled callbacks using the following
too:
SSL_set_msg_callback

And I see a lot of that happening but not in this case.
In this particular case, after switching the destination IP and port all
we get is what I showed you. Not even one single byte is exchanged
anywhere.

Looking inside ssl_stat.c I see the following:
case SSL23_ST_CW_CLNT_HELLO_A:  str=23WCHA; break;

Looking inside s23_clnt.c I see these lines near the beginning of
ssl23_client_hello():

buf=(unsigned char *)s-init_buf-data;
if (s-state == SSL23_ST_CW_CLNT_HELLO_A)

How can my code start in this state?

Any hints would be appreciated.
thanks
jeff



Re: Running SSL on own socket code

2011-06-03 Thread Jeff Saremi
Yes it was as straightforward as you mentioned.
Thanks to those who responded.
jeff

On 11-06-02 05:47 AM, Neo Liu wrote:
 
 
 On Wed, Jun 1, 2011 at 10:22 PM, Victor Duchovni
 victor.ducho...@morganstanley.com
 mailto:victor.ducho...@morganstanley.com wrote:
 
 On Tue, May 31, 2011 at 09:05:29AM -0400, Jeff Saremi wrote:
 
  I'd like to know the feasibility or complexity around using my own
  socket code with OpenSSL's ssl code. If I provide OpenSSL with a
 pair of
  BIOs to read and write would that be sufficient? How tightly
 integrated
  the code is with bio_connect and bio_socket? thanks
  jeff
 
 man BIO_new_bio_pair
 
 Look at the example.
 
 
 As Victor pointed that you can use BIO pair to handle data transmission
 and separate data transmission procedure from SSL handshake and
 encrypt/decrypt procedure.
 Using BIO pair, the SSL structure only handle the data in SSL Record
 layer but not any lower layer.
 
 --
Viktor.
 __
 OpenSSL Project
 http://www.openssl.org
 
 http://console.mxlogic.com/redir/?nS6mkQm4PrapEVssoo76M0llLxix_00jt-psLuZXTLsTsTkN3UBWHv2B3OXtfzg5lm-5a7Y01dKc9zzqbdNRXL8Kf6Sm3obZ8Qg0JK49g8Cy0o60Gq8aMd45j43h1iJyLPd45GEurDUvf5zZB0SyrhdIFCzBNNdNwSXjFrmHp
 User Support Mailing List  
  openssl-users@openssl.org mailto:openssl-users@openssl.org
 Automated List Manager  
 majord...@openssl.org mailto:majord...@openssl.org
 
 
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Running SSL on own socket code

2011-06-01 Thread Jeff Saremi
I'd like to know the feasibility or complexity around using my own
socket code with OpenSSL's ssl code. If I provide OpenSSL with a pair of
BIOs to read and write would that be sufficient? How tightly integrated
the code is with bio_connect and bio_socket? thanks
jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Valgrind Suppressed Leak on dlfcn_globallookup

2011-05-13 Thread Jeff Saremi
I'd like to eliminate this suppressed error in valgrind.
Does anyone have any idea? I have my cleanup code also pasted father below

==3317== 20 bytes in 1 blocks are still reachable in loss record 1 of 1
==3317==at 0x402425F: calloc (vg_replace_malloc.c:467)
==3317==by 0x4063105: _dlerror_run (dlerror.c:142)
==3317==by 0x4062B40: dlopen@@GLIBC_2.1 (dlopen.c:88)
==3317==by 0x82A1A99: dlfcn_globallookup (dso_dlfcn.c:472)


ENGINE_cleanup();
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
ERR_free_strings();
OBJ_NAME_cleanup(-1);
CRYPTO_cleanup();

ERR_remove_thread_state(NULL);

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Possibility to create CRL without the CA key

2011-05-02 Thread Jeff Saremi
read my post:
http://www.mail-archive.com/openssl-users@openssl.org/msg63740.html


On 11-05-02 06:50 AM, Viliam Ďurina wrote:
 Hello,

 I'm doing my own CA with openssl and want to regularly generate CRLs.
 We plan limited use of the CA (say 1-2 certificates per year), so the
 CA private key is stored in a safe on a USB stick until it is used
 next time. But, as far as I know, we will need it to generate CRL
 quite often. I see two possible solutions:

 1. be able to sign the CRL with another key, signed with that CA: is
 this possible?

 2. generate the CRL with very long validity (say 1 year) and
 regenerate a new one when needed: isn't this breaking some PKI rules
 or common practices?

 Thanks,
 Viliam

 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   majord...@openssl.org
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: CRL validation must be skipped for certs with no CRLDPs

2011-03-19 Thread Jeff Saremi
I'm not sure how you read this. I read it like a programmer.
In programming primitives, the spec would be coded like this:

Here's the spec:
This algorithm begins by assuming that the certificate is not revoked
For each distribution point (DP) in the certificate's CRL distribution
points extension, for each corresponding CRL 

And here's the C code:

cert.status = UNREVOKED;
for (i = 0; i  cert.crldp.size; ++i)
{
  /* more processing loops */
}

Right there, the main loop should not even execute because
cert.crldp.size is zero.
But let's play along and say that for some unknown reason we get to the
section of the spec you're referring to:

Here's the spec:

 I think you should read on.  Specifically, the last paragraph seems to
 me to indicate different behaviour is intended:
 
If the revocation status has not been determined, repeat the process
above with any available CRLs not specified in a distribution point
but issued by the certificate issuer.  

Here's the code:

cert.status = NOT_REVOKED;
for (i = 0; i  cert.crldp.size; ++i)
{
  /* some processing loops */
  if(cert.status == UNDETERMINED)
  {
/* do what Bruce Stephens suggested */
  }
}

As you can see again there's another stop and that stop is that our
certificate's status is not UNDETERMINED but rather UNREVOKED.

But lets view this whole thing from another perspective:
I have a limited certificate authority in my organization. have a root
cert which does not get revoked. I distribute that to the ones who want
to deal with me. I also generate a multitude of endpoint certificates. I
do not intend for any of these to become revoked, ever. Hence, I do not
bother with the process of certificate revocation and CRL issuance. Now
as a result of OpenSSL's imlementation, none of my clients who use
OpenSSL will be able to deal with me online. Because my certificates do
not have a CRL and CRLDP period. Should I stop doing business
altogether? Should I contact my business partners and tell them that
they should be applying a patch to their code, overriding verification
failure in their certVerifyCallbacks? Let's just think that through a
little.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Need Help with Programmatic Downloading+Checking of CRLs

2011-03-18 Thread Jeff Saremi
 There are other out of band mechanisms where a CRL might be available but
 not mentioned in a CRLDP. OpenSSL has no way of telling what those might be
 and if the absence is really an error or not.
 
 The best you can do is trap the issuer error in the verify callback and ignore
 it if appropriate.
 
 Steve.
 --
 Dr Stephen N. Henson. OpenSSL project core developer.
 Commercial tech support now available see: http://www.openssl.org

Is introducing a mechanism to lookup_crl to allow this bypass unreasonable?

Or introducing an override method (like the pointers in X509_STORE) to
check if the code should ask for a CRL or not? Such as the following:

static int check_revocation(X509_STORE_CTX *ctx)
{
int i, last, ok;
if (!(ctx-param-flags  X509_V_FLAG_CRL_CHECK))
return 1;
if (ctx-param-flags  X509_V_FLAG_CRL_CHECK_ALL)
last = sk_X509_num(ctx-chain) - 1;
...

for(i = 0; i = last; i++)
{
ctx-error_depth = i;
if(ctx-crl_check_required(i))
{
ok = check_cert(ctx);
if (!ok) return ok;
}
}
return 1;
}

crl_check_required(int i) in the default (most simplistic case) could
just do a check on CRLDP in the certificate. And if as you said there
are other CRLs that could have been provided, then one could overwrite it.


Here's another suggestion:

There's a lot of logic and functionality in the following methods:
check_cert()
and
get_crl_delta()

If these could be overwrite-able in X509_STORE would be great.
Especially get_crl_delta.
If get_crl defaulted to get_crl_delta that solution would still be
workable as well..
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Handling Indirect CRL Issuer

2011-03-18 Thread Jeff Saremi
With great many thanks to Dr. Henson for not only responding to every
post I have had so far but also for providing solid guidance on how to
address the problem leading to the heading of this thread, I am adding
some extra material and some verbatim quotes from Dr. Henson here so
that they might be of some benefit to some one.

 What you do is to generate a CRL issuing certificate which has exactly the
 same subject, issuer name as the CA. In that certificate include a keyUsage
 extension with only the crl signing bit asserted. If you had the option the CA
 certificate should have keyUsage and certsign but NOT crl sign set.
 
 You then issue CRLs from this second certificate which will have a different
 AKID. Then OpenSSL will use that certificate (if it can find it) instead of
 the CA certificate.

To create a second certificate duplicating an existing one completely
you may face some challenges, but the following two commands should
help. Also you may want to possibly use -preserveDN command line
option as well as setting preserve=yes in your config file:

 openssl x509 -in cert.pem -signkey newkey.pem -out newcert.pem
 
 This should convert an existing certificate into a self signed version with a
 new key. From there you can convert it into a certificate request with:
 
 openssl x509 -in newcert.pem -x509toreq -signkey newkey.pem

Also make sure you create those AuthorityKeyIdentifiers in your
certs/crls by having lines like the following in appropriate places in
your config:
authorityKeyIdentifier=keyid,issuer:always

Finally, let's assume you are in possession of your 2nd certificate (or
the Indirect CRL Issuer's certificate). For this to be processed
properly you would need to add it to X509_STORE_CTX as an untrusted
cert. Setting it along with your trust chain certs won't work.

To do that and since I had to do this in the context of an SSL
connection, I decided to use a callback like the following:

a) create an app verify cert callback:
int appVerifyCallback(X509_STORE_CTX *ctx,void *arg)
{
STACK_OF(X509*) untrustedStack = sk_X509_new_null();
// add your untrusted certs such as the 2nd CA cert
// or your Indirect CRL Issuer to the stack
X509 *cert = ...
sk_X509_push(untrustedStack, cert);

// this call sets the ctx-untrusted
X509_STORE_CTX_set_chain(ctx, untrustedStack);
return 1;
}

b) add this to your SSL context:
SSL_CTX_set_cert_verify_callback(mCtx,
appVerifyCallback,
(void*)untrustedCerts);

And you should be all set to validate those certs and CRLs.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


CRL validation must be skipped for certs with no CRLDPs

2011-03-18 Thread Jeff Saremi
This was mentioned briefly in another thread by myself. I thought it
deserved its own discussion. The copies of how it went on are pasted below.


Section 6.3.3. of RFC 5280 - CRL Processing
This algorithm begins by assuming that the certificate is not revoked
For each distribution point (DP) in the certificate's CRL distribution
points extension, for each corresponding CRL 

So my expectation is that after I instruct OpenSSL to perform CRL
checking -- whether I set or not set any CRLs -- no checking must be
done on any certificates which don't have CRLDP in them.

The spec ofcourse mentions that implementations are not required to
follow this algorithm, however, it also mentions that the end result
must be the same as when they did.

Now as an average user of OpenSSL API, I expect not to have to write any
piece of code (such as over-ruling the validation failure in validation
callback) for the normal process of certificate/CRL validation to take
its course. Is this a reasonable expectation?

thanks
Jeff


* Original Problem Statement  
Re: Need Help with Programmatic Downloading+Checking of CRLs
...

 So as per previous posts, I implemented lookup_crl().
 Now one of the major problems is what do I return from this method, if
 the certificate has no CRL distribution points!
 Returning an empty stack causes get_crl_delta() to fail.
 Is there a flag that I can setup to let this cert be excluded from CRL
 checking?
 Is that something I should be doing in lookup_crl? Or should the
 framework be smart enough not to even ask me for a CRL in this case?
 
 thanks
 jeff


 There are other out of band mechanisms where a CRL might be available but
 not mentioned in a CRLDP. OpenSSL has no way of telling what those might be
 and if the absence is really an error or not.
 
 The best you can do is trap the issuer error in the verify callback and ignore
 it if appropriate.
 
 Steve.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


what does X509_STORE_get1_crls() return and how?

2011-03-17 Thread Jeff Saremi
If I call X509_STORE_get1_crls(ctx, nm) with nm being the issuer name,
the method is supposed to return a list of CRL's with that issuer name.
How does it do that when it comes to CRLs issued by a CRL issuer
authorized by the original issuer?
Does it use Authority Key Identifier?

thanks,
jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Need Help with Programmatic Downloading+Checking of CRLs

2011-03-17 Thread Jeff Saremi
So as per previous posts, I implemented lookup_crl().
Now one of the major problems is what do I return from this method, if
the certificate has no CRL distribution points!
Returning an empty stack causes get_crl_delta() to fail.
Is there a flag that I can setup to let this cert be excluded from CRL
checking?
Is that something I should be doing in lookup_crl? Or should the
framework be smart enough not to even ask me for a CRL in this case?

thanks
jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Handling Indirect CRL Issuer

2011-03-17 Thread Jeff Saremi
Does anyone have an example of how an indirect CRL issuer is handled?
This is my understanding of needs to be done.
If at least someone could verify that, I'd be really appreciative:

1. download the CRL
2. If not indirect, handle as usual (let's pretend for now that we know
how to handle these in OpenSSL)
3. If Indirect flag is set, check Authority Information Access.
(possibly using something like:
AUTHORITY_INFO_ACCESS *info = (AUTHORITY_INFO_ACCESS*)
X509_CRL_get_ext_d2i(crl, NID_info_access, NULL, NULL);)
4. Download the issuer's certificate using the URL above.
5. Add the cert to the store? (using X509_STORE_add_cert()?)

Any other steps?

thanks
jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Handling Indirect CRL Issuer

2011-03-17 Thread Jeff Saremi
It looks like we need to support indirect CRL Issuers at least for CRL's
issued for ourselves.

I have done most of the work. It looks I don't quite know how to
generate CRLs with the indirect CRL issuer or I don't know how to
generate the CRL issuer's certificate using the root certificate.

So I have added the CRL issuer's cert to the trusted ones. But when I'm
trying to use the CRL i get stopped here:


crl_akid_check()
{
...
  if(X509_check_akid()
// this is where if fails


and inside X509_check_akid()

...
/* Check key ids (if present) */
if(akid-keyid  issuer-skid 
 ASN1_OCTET_STRING_cmp(akid-keyid, issuer-skid) )
return X509_V_ERR_AKID_SKID_MISMATCH;


There's definitely something I don't know about AKID's and how to set
them properly.

To help you out here are the certificates and CRLs (i have masked some
fields):

*** Our ROOT cert *
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 0 (0x0)
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=TestMoregaRootCA, C=CA, O=TestMorega
Validity
Not Before: Jun  8 00:29:30 2010 GMT
Not After : Jun  3 00:29:30 2030 GMT
Subject: CN=TestMoregaRootCA, C=CA, O=TestMorega
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus:
...
6c:68:70:a5:c1:7e:5e:b8:e4:82:ff:6d:c6:3
X509v3 extensions:
X509v3 Subject Key Identifier:
70:8F:22:BC:D7:55:20:6E:00:D7:3A:D3:70:40:F5:49:91:20:90:60
X509v3 Authority Key Identifier:

keyid:70:8F:22:BC:D7:55:20:6E:00:D7:3A:D3:70:40:F5:49:91:20:90:60
DirName:/CN=TestMoregaRootCA/C=CA/O=TestMorega
serial:00
X509v3 Key Usage: critical
Certificate Sign, CRL Sign
X509v3 Basic Constraints: critical
CA:TRUE



 CRL Issuer Cert issued by the root 
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 20 (0x14)
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=TestMoregaRootCA, C=CA, O=TestMorega
Validity
Not Before: Mar 16 18:31:26 2011 GMT
Not After : Mar 11 18:31:26 2031 GMT
Subject: C=CA, O=TestMorega, CN=TestMoregaCRLIssuer
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
...
1c:52:ce:81:2c:50:52:30:43
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Key Identifier:
7F:AC:68:90:EE:3C:8B:7B:6D:0E:A0:71:68:BE:57:D0:45:42:E9:C6
X509v3 Authority Key Identifier:

keyid:70:8F:22:BC:D7:55:20:6E:00:D7:3A:D3:70:40:F5:49:91:20:90:60
DirName:/CN=TestMoregaRootCA/C=CA/O=TestMorega
serial:00
X509v3 Key Usage: critical
Digital Signature, CRL Sign


 A sample CRL issued by the Indirect CRL Issuer 
Certificate Revocation List (CRL):
Version 2 (0x1)
Signature Algorithm: sha256WithRSAEncryption
Issuer: /C=CA/O=TestMorega/CN=TestMoregaCRLIssuer
Last Update: Mar 17 12:56:55 2011 GMT
Next Update: Apr 16 12:56:55 2011 GMT
CRL extensions:
X509v3 Authority Key Identifier:

keyid:7F:AC:68:90:EE:3C:8B:7B:6D:0E:A0:71:68:BE:57:D0:45:42:E9:C6
DirName:/CN=TestMoregaRootCA/C=CA/O=TestMorega
serial:14
X509v3 Issuing Distrubution Point: critical
Full Name:
  URI:http://localhost/
Indirect CRL
Authority Information Access:
CA Issuers - URI:http://localhost/crlissuer.cer
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


How can I make CertificateIssuer extension show up in CRL Entries?

2011-03-17 Thread Jeff Saremi
I'm generating my CRLs using openssl ca command.  In the CRL entry
extension list, I can see X509v3 CRL Reason Code but I'd like to also
include the certificate issuer. (I think this is needed if an issuer
does the issuing indirectly for another CA).

Is there a command line option of config entry for that?
thanks
jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Need Help with Programmatic Downloading+Checking of CRLs

2011-03-16 Thread Jeff Saremi
Thanks Patrick. Unfortunately this has be a part of our code to run on
various platforms. If you know of any openssl-based implementation that
does this and is opensource please let me know so at least I could use
that as an example.
 
 Patrick Patterson
 Tue, 15 Mar 2011 13:11:11 -0700
 
 Hi Jeff:
 
 If you are looking for a solution that not only handles CRL but OCSP as well, 
 you might want to check out Pathfinder:
 
 http://www.carillon.ca/tools/pathfinder.php
 
 It allows you to easily add a custom callback to the _verify() routines that 
 will enable all of this. It also does caching and complex path resolution, in 
 case that is interesting to you.
 
 Best Regards,
 
 Patrick.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Need Help with Programmatic Downloading+Checking of CRLs

2011-03-16 Thread Jeff Saremi
 Try supplying your own lookup_crls() implementation instead. This can be much
 simpler and just needs to return any CRLs which match the supplied X509_NAME
 value. If there are multiple CRLs it will pick the most appopriate.
 
 Steve.
 --
 Dr Stephen N. Henson. OpenSSL project core developer.
 Commercial tech support now available see: http://www.openssl.org

That's a lot better. Thanks

I'd like to describe the steps I'm taking in my lookup function. If
someone could verify them I would be grateful:

1. try to get crls by calling X509_STORE_get1_crls with passed arguments.
2. If the stack is not empty then return it to the caller
3. Otherwise, get the current certificate's CRL distribution point by
using X509_STORE_CTX_get_current_cert() and a bunch of other lines I
pasted in my other email
4. Get the CRL by fetching the URL
5. Now do another call to the store based on the name of the CRL issuer:
X509_STORE_get1_crls(ctx, X509_CRL_get_issuer(crl))
6. If this call return any CRLs that means the CRL existed in the store
but the CRL Issuer was different than the certificate Issuer. (if I
understood the spec correctly, this is quite possible)
7. If no CRLs were found, then add the downloaded CRL: X509_STORE_add_crl()
8. Do another call to X509_STORE_get1_crls() and return the results
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Need Help with Programmatic Downloading+Checking of CRLs

2011-03-15 Thread Jeff Saremi
Here are some more interesting points that I'm banging my head against
the wall until I find the answer:

- Overwriting get_crl forces you to provide your own CRL checking logic
as well. Specifically two things need to be set during this check which
are required witin check_cert():
a) score of this CRL
b) current_reason

For now -- just to get going to the next step -- I had to come up with
the following kludge in my get_crl():
#define CRL_SCORE_VALID (/*CRL_SCORE_NOCRITICAL*/
0x100|/*CRL_SCORE_TIME*/
0x040|/*CRL_SCORE_SCOPE*/0x080|/*CRL_SCORE_SAME_PATH*/0x008)

  ctx-current_crl_score |= CRL_SCORE_VALID;
  ctx-current_reasons = 0x807f; // CRLDP_ALL_REASONS;

- It isn't clear if I need to add my CRL -- after being downloaded -- to
the X509_STORE within get_crl(). For now I have added it similar to the
following:

  STACK_OF(X509_CRL)* crl_sk = X509_STORE_get1_crls(ctx,
  X509_CRL_get_issuer(*crl));
  if(!sk_X509_CRL_num(crl_sk))
  {
if ((rc = X509_STORE_add_crl(ctx-ctx, *crl)) = 0)
break;
  }
  sk_X509_CRL_free(crl_sk);


- It seems that at the end of the chain, when usually there is a
self-signing certificate, one will end up with two of the same calls to
get_crl() with the same issuer. There is a possibility that one could
check X509_STORE and fill the passed parameter X509_CRL** with that.

- For certificates which do not have a CRL distribution point, what is
one supposed to do? Return 0 or 1? What should the X509_CRL** be filled
with?

thanks
Jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Cert Verification based on CRL when least expected

2011-03-12 Thread Jeff Saremi
We're trying to enable CRL checking on our client-side application. When
doing limited unit tests, everything is OK. But when we extend the tests
to real server we see errors from places where least expected.

The error is unable to get certificate CRL depth:0. The scenario is a
mutually authenticated SSL connection with the presence of 2 CRL records
on the client side.

None of the CRL records on the client side, have anything at all to do
with the server we're trying to handshake with. And that is the puzzling
fact. The server's certificate is pure and is genuinely signed by
VeriSign. The CRLs are related to two internal certs we issues by our
self-signed root. (which are at the time of test completely out of the
picture).

The SSL error is always this:
SSL error 'certificate verify failed' (file:.\ssl\s3_clnt.c line:1056
data:'')
That's the one stop that I think all errors are caught.

Now i need guidance on the best way to troubleshoot this. Is there a
debug flag or print flag I can turn on during the certificate validation
to see all details? I cannot use the verify tool of course.

thanks
Jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


RE: SSL_VERIFY_PEER and the presence of client's X509 certificate after the handshake

2010-12-18 Thread Jeff Saremi
So this is some minor debugging I did to get to this problem.
Modified the following methods to add two printf lines:

ssl_lib.c:
X509 *SSL_get_peer_certificate(const SSL *s)
{
X509 *r;

if ((s == NULL) || (s-session == NULL))
{
printf(SSL_get_peer_certificate: s or session was null. returning
null x509\n);
r=NULL;
}
else
{
printf(SSL_get_peer_certificate: returning session-peer:
%p\n, s-session-peer);
r=s-session-peer;
}
...

d1-srvr.c:
int dtls1_accept(SSL *s)
{
...
case SSL3_ST_SW_CERT_REQ_A:
case SSL3_ST_SW_CERT_REQ_B:
if (/* don't request cert unless asked for it: */
...
else
{
s-s3-tmp.cert_request=1;
dtls1_start_timer(s);
ret=dtls1_send_certificate_request(s);
printf(ssl_accept: sent cert request; rc=%d\n, ret);
...

Recompiled and re-linked. When a call comes from the client I see the
following two lines:

ssl_accept: sent cert request; rc=1
...
SSL_get_peer_certificate: returning session-peer: (nil)


The same client and the same server, moments later, have the following
printouts:

...
ssl_accept: sent cert request; rc=1
...
SSL_get_peer_certificate: returning session-peer: 0xd74258

I cannot be 100% sure what changes on the client or on the server in
between. But the low-level client socket and ssl connections are exactly
the same in both scenarios. Also both use OpenSSL 1.0a
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


SSL_VERIFY_PEER and the presence of client's X509 certificate after the handshake

2010-12-15 Thread Jeff Saremi
We have some intermittent problems which seem to go away after
restarting our server.
The problem is that the client's certificate disappears on the server,
even though SSL_VERIFY_PEER is set in the context using
SSL_CTX_set_verify().

So under situations that are not entirely clear, a call to
SSL_get_peer_certificate() returns null after a successful SSL accept is
done on the server.

My question is if there are conditions under which one cannot rely on
the presence of the peer certificate even if SSL_VERIFY_PEER is set?

thanks
Jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Enhancement Request: 64bit BIO API

2010-10-12 Thread Jeff Saremi
In another hi-jacked thread I think it was determined that the current
OpenSSL BIO API does not support 64bit operations. This post is to
request that such support be added to OpenSSL.

With the 32bit operating systems disappearing fast on desktops and
servers, with the ever-increasing involvement of cryptography in media
technologies (DRM), and insatiable appetite to stream larger and
higher-def media files, the need for 64bit BIO is felt ever than before.

From the perspective of a user of such API, I don't have a preference on
how it's done:

- as a set of separate API above and beyond what is there now -acts like
32 under 32bits (add 'l' or '64' prefixes or suffixes at will)
- as a transparent approach: in 64bit compilations you get 64bit
versions otherwise 32
- as a complementary set always available regardless of the underlying
addressing capability

Thanks,
Jeff Saremi
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


RE: Getting detailed ssl-handshake debug output

2010-10-11 Thread Jeff Saremi
 I received the answer in a direct email and just wanted to share it
here too:

- command line:

openssl s_client -state -debug -connect host:port

- programmatic:

One can look in the callback mechanism used in the above, specifically in 
apps/s_cb.c
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Getting detailed ssl-handshake debug output

2010-10-08 Thread Jeff Saremi
 I'd like to know if there's a way -- programmatic, config, environment
-- that I can get detailed print of what goes on during a handshake at
the client or the server? Below is the output from Apache Tomcat as an
example of the level of details i'm looking for:

http-442-1, READ: TLSv1 Handshake, length = 73
*** ClientHello, TLSv1
RandomCookie:  GMT: 1269551866 bytes = { 178, 23, 135, 211, 154, 110,
144, 59, 9
9, 139, 224, 45, 156, 231, 232, 123, 36, 95, 187, 165, 56, 121, 211, 63,
117, 43
, 7, 82 }
Session ID:  {}
Cipher Suites: [TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
TLS_DHE_DSS_WITH_AES_256_CBC_S
HA, TLS_RSA_WITH_AES_256_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
SSL_DHE_DSS
_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA,
TLS_DHE_RSA_WITH_AES_128_
CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA,
SSL_RSA
_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_MD5, Unknown 0x0:0xff]
Compression Methods:  { 0 }
Unsupported extension type_35, data:
***
%% Created:  [Session-1, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA]
*** ServerHello, TLSv1
RandomCookie:  GMT: 1269551766 bytes = { 32, 121, 10, 209, 123, 137,
160, 183, 1
86, 107, 255, 108, 79, 16, 190, 91, 180, 86, 18, 136, 232, 108, 249,
191, 90, 17
6, 87, 231 }
Session ID:  {76, 172, 211, 150, 251, 114, 230, 220, 75, 218, 174, 105,
134, 185
, 144, 119, 92, 182, 1, 58, 247, 172, 121, 90, 212, 100, 58, 220, 93,
76, 97, 11
1}
Cipher Suite: SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Compression Method: 0
***
Cipher suite:  SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
*** Certificate chain
chain [0] = [
[
  Version: V1
  Subject: OU=Tomcat, O=ACME, emailaddress=tom...@acme.com, C=CA,
CN=localhost
  Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
 
  Key:  Sun RSA public key, 512 bits
  modulus:
973285574783538290665814718553460486271776249697428968977460338357983
...
  public exponent: 65537
  Validity: [From: Mon Jun 21 14:33:25 EDT 2010,
   To: Tue Jun 21 14:33:25 EDT 2011]
  Issuer: OU=Root CA, O=ACME Systems Inc., L=TEST PURPOSES ONLY, C=CA,
CN=ACME Systems Root CA
  SerialNumber: [02]
 
]
  Algorithm: [SHA1withRSA]
  Signature:
: A5 A9 E6 5F BE 51 75 E5   E3 25 9D 92 AB 45 FA 1E  ..._.Qu..%...E..
...
 
]
***
*** Diffie-Hellman ServerKeyExchange
DH Modulus:  { 233, 230, 66, 89, 157, 53, 95, 55, 201, 127, 253, 53,
103, 18, 11
... }
DH Base:  { 48, 71, 10, 213, 160, 5, 251, 20, 206, 45, 157, 205, 135,
227, 139,
... }
Server DH Public Key:  { 159, 193, 69, 114, 138, 167, 128, 50, 5, 51,
77, 127, 2
...}
Signed with a DSA or RSA public key
*** CertificateRequest
Cert Types: RSA, DSS
Cert Authorities:
OU=Root CA, O=ACME Systems Inc., C=CA, CN=ACME Systems Root CA
OU=Root CA, O=ACME Systems Inc., L=TEST PURPOSES ONLY, C=CA,
CN=ACME Systems Root CA
CN=TESTCA, OU=CA, O=TEST
*** ServerHelloDone
http-442-1, WRITE: TLSv1 Handshake, length = 1544
http-442-1, READ: TLSv1 Handshake, length = 3309
*** Certificate chain
chain [0] = [
[
  Version: V3
  Subject: CN=fd0172c2-3f02-432e-8317-097b8fabff7d, OU=Windows/1.00,
O=instance
  Signature Algorithm: SHA256withRSA, OID = 1.2.840.113549.1.1.11
 
  Key:  Sun RSA public key, 1024 bits
  modulus:
128531339772544414974300233324968135333513753311766363920169114394683
...
 
  public exponent: 65537
  Validity: [From: Tue Oct 05 17:49:02 EDT 2010,
   To: Wed Oct 05 17:49:02 EDT 2011]
  Issuer: CN=TESTActivationCA, OU=Activation CA, O=TEST ACTIVATION
  SerialNumber: [012b7e5e 79df]

[2]: ObjectId: 2.5.29.17 Criticality=false
SubjectAlternativeName [
  CN=guest, OU=ACME PC Client, O=instance
]
 
[3]: ObjectId: 2.5.29.15 Criticality=true
KeyUsage [
  DigitalSignature
  Key_Encipherment
  Key_Agreement
]
 
[4]: ObjectId: 2.5.29.19 Criticality=true
BasicConstraints:[
  CA:false
  PathLen: undefined
]
 
]
  Algorithm: [SHA256withRSA]
  Signature:
: 97 32 64 63 D4 DA ED AF   CD 7F EC 77 A6 7C 72 85  .2dc...w..r.
...
 
]
chain [1] = [
[
  Version: V3
  Subject: CN=TESTActivationCA, OU=Activation CA, O=TEST ACTIVATION
  Signature Algorithm: SHA256withRSA, OID = 1.2.840.113549.1.1.11
 
  Key:  Sun RSA public key, 2048 bits
  modulus:
241401315179803415263681113133745704037912047640810783616090692543408
...
  public exponent: 65537
  Validity: [From: Wed Jun 09 14:04:45 EDT 2010,
   To: Thu Jun 09 14:04:45 EDT 2011]
  Issuer: OU=Root CA, O=ACME Systems Inc., L=TEST PURPOSES ONLY, C=CA,
CN=ACME Systems Root CA
  SerialNumber: [01]
 
Certificate Extensions: 6
[1]: ObjectId: 2.5.29.30 Criticality=true
NameConstraints: [
Permitted:   GeneralSubtrees:
[
   GeneralSubtree: [
GeneralName: O=instance
Minimum: 0  Maximum: undefined]
]
   ]
 
[2]: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
: 7C FB 2B 96 C9 0D 37 89   01 83 D9 5A 67 41 3B 3C  ..+...7ZgA;
0010: E7 45 81 43.E.C
]
]
 
[3]: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
: 70 8F 22 BC D7 55 20 6E   

Re: 64bit BIOs and support in OpenSSL

2010-10-06 Thread Jeff Saremi


Are there any plans to change this? Getting streams larger than 4GB is not very 
unusual these days anymore.


 On Mon, Oct 04, 2010 at 10:37:55AM -0400, Jeff Saremi wrote:

   Does BIO support 64 bit IO (large files)? If so would the rest of
  OpenSSL (such as the ssl itself) support those BIOs?
  I configured the build with 64bit support and didn't see any noticeable
  changes.
  Specifically, I'd like to know if BIO_tell() is able to return a 64bit
  value?

 No, BIO_tell() is a macro:

 include/openssl/bio.h:
   #define BIO_tell(b)   (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)

 The (int) cast means that the result is never larger than INT_MAX.

 If the library is compiled on a machine with 64-bit longs, then
 the underlying BIO_ctrl() will return the value from lseek() or
 ftell() cast to a (long). This does not imply that 64-bit files
 will not break in some other way.

 -- 
   Viktor.
 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   majord...@openssl.org
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


64bit BIOs and support in OpenSSL

2010-10-04 Thread Jeff Saremi
 Does BIO support 64 bit IO (large files)? If so would the rest of
OpenSSL (such as the ssl itself) support those BIOs?
I configured the build with 64bit support and didn't see any noticeable
changes.
Specifically, I'd like to know if BIO_tell() is able to return a 64bit
value?
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Is there a function to invoke ad-hoc to report an error without having to load/unload strings?

2010-08-25 Thread Jeff Saremi
 I'm looking for something like:

ERR_report_oneoff_error(const char *func, const char *reason, int line,
const char *file)

that I could use without having to define structures like the following
or calling Err_load_strings and Err_unload_strings:
static ERR_STRING_DATA BIO_str_functs[]=
{
{ERR_FUNC(BIO_F_ACPT_STATE),ACPT_STATE},
{ERR_FUNC(BIO_F_BIO_ACCEPT),BIO_accept},
...
}


static ERR_STRING_DATA BIO_str_reasons[]=
{
{ERR_REASON(BIO_R_ACCEPT_ERROR)  ,accept error},
{ERR_REASON(BIO_R_BAD_FOPEN_MODE),bad fopen mode},
...
}

thanks
jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: dynamic locks don't get cleaned up

2010-08-20 Thread Jeff Saremi
 It's saddening for the problem to exist in the first place but it's
more when no body gives it the time of the day.
But that's life.
I went and fixed the problem on my own:

in crypto.h i declared:

void CRYPTO_cleanup();


and in cryptlib.c i wrote:

void CRYPTO_cleanup()
{
if(dyn_locks)
sk_CRYPTO_dynlock_free(dyn_locks);
if(app_locks)
sk_OPENSSL_STRING_free(app_locks);

}


and i my own application I added a call to the newly added method:
ENGINE_cleanup();
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
ERR_free_strings();
OBJ_NAME_cleanup(-1);
 CRYPTO_cleanup();


Running my application with Valgrind produces the following output.
That's what we'd like to see:
==3959==
==3959== HEAP SUMMARY:
==3959== in use at exit: 0 bytes in 0 blocks
==3959==   total heap usage: 4,496 allocs, 4,496 frees, 137,484 bytes
allocated
==3959==
 ==3959== All heap blocks were freed -- no leaks are possible


On 10-08-18 04:28 PM, Jeff Saremi wrote:
  any takers from the openssl team? true, false? known issue, user error?
 anything?

 On 10-08-17 04:23 PM, Jeff Saremi wrote:
 I apologize if this shows up more than once. I've been having problems
 sending emails out, all day.

  First I encountered this with valgrind but then I decided to have
 openssl print the leaks and it was also confirmed.
 I have reduced my code to the following two lines. Prior to this if
 course initilization of openssl and then the cleanup. Either there's a
 call that I'm missing or the the dynamic locks don't get cleaned up upon
 exit. Looking at the code in cryptlib.c, i don't see anywhere freeing up
 the memory allocated to the following stacks:

 static STACK_OF(OPENSSL_STRING) *app_locks=NULL;
 static STACK_OF(CRYPTO_dynlock) *dyn_locks=NULL;

 And here's my sample code:
 int l = CRYPTO_get_new_dynlockid();
 CRYPTO_destroy_dynlockid(l);

 Before this I have a bunch of lines like:
 CRYPTO_malloc_debug_init();
 CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
 CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);

 SSL_library_init();
 OpenSSL_add_all_digests();
 CRYPTO_set_id_callback(..);
 CRYPTO_set_locking_callback(...);
 CRYPTO_set_dynlock_create_callback(...);
 CRYPTO_set_dynlock_lock_callback(...);
 CRYPTO_set_dynlock_destroy_callback(...);

 And at the end of the code I have something like:
 CRYPTO_set_id_callback(NULL);
 CRYPTO_set_locking_callback(NULL);
 CRYPTO_set_dynlock_create_callback(NULL);
 CRYPTO_set_dynlock_lock_callback(NULL);
 CRYPTO_set_dynlock_destroy_callback(NULL);

 ENGINE_cleanup();
 EVP_cleanup();
 CRYPTO_cleanup_all_ex_data();
 ERR_free_strings();
 OBJ_NAME_cleanup(-1);
 ERR_remove_thread_state(NULL);
 SSL_free_comp_methods();
 CRYPTO_mem_leaks_fp(stderr);

 As you can see I have included every cleanup call I could find.
 Running the code produces the following output:
 [19:49:10]   188 file=stack.c, line=125, thread=19596, number=20,
 address=08DF0E50
 [19:49:10]   189 file=stack.c, line=127, thread=19596, number=16,
 address=08DF0F78
 36 bytes leaked in 2 chunks




 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   majord...@openssl.org
 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   majord...@openssl.org


Re: dynamic locks don't get cleaned up

2010-08-18 Thread Jeff Saremi
 any takers from the openssl team? true, false? known issue, user error?
anything?

On 10-08-17 04:23 PM, Jeff Saremi wrote:
 I apologize if this shows up more than once. I've been having problems
 sending emails out, all day.

  First I encountered this with valgrind but then I decided to have
 openssl print the leaks and it was also confirmed.
 I have reduced my code to the following two lines. Prior to this if
 course initilization of openssl and then the cleanup. Either there's a
 call that I'm missing or the the dynamic locks don't get cleaned up upon
 exit. Looking at the code in cryptlib.c, i don't see anywhere freeing up
 the memory allocated to the following stacks:

 static STACK_OF(OPENSSL_STRING) *app_locks=NULL;
 static STACK_OF(CRYPTO_dynlock) *dyn_locks=NULL;

 And here's my sample code:
 int l = CRYPTO_get_new_dynlockid();
 CRYPTO_destroy_dynlockid(l);

 Before this I have a bunch of lines like:
 CRYPTO_malloc_debug_init();
 CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
 CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);

 SSL_library_init();
 OpenSSL_add_all_digests();
 CRYPTO_set_id_callback(..);
 CRYPTO_set_locking_callback(...);
 CRYPTO_set_dynlock_create_callback(...);
 CRYPTO_set_dynlock_lock_callback(...);
 CRYPTO_set_dynlock_destroy_callback(...);

 And at the end of the code I have something like:
 CRYPTO_set_id_callback(NULL);
 CRYPTO_set_locking_callback(NULL);
 CRYPTO_set_dynlock_create_callback(NULL);
 CRYPTO_set_dynlock_lock_callback(NULL);
 CRYPTO_set_dynlock_destroy_callback(NULL);

 ENGINE_cleanup();
 EVP_cleanup();
 CRYPTO_cleanup_all_ex_data();
 ERR_free_strings();
 OBJ_NAME_cleanup(-1);
 ERR_remove_thread_state(NULL);
 SSL_free_comp_methods();
 CRYPTO_mem_leaks_fp(stderr);

 As you can see I have included every cleanup call I could find.
 Running the code produces the following output:
 [19:49:10]   188 file=stack.c, line=125, thread=19596, number=20,
 address=08DF0E50
 [19:49:10]   189 file=stack.c, line=127, thread=19596, number=16,
 address=08DF0F78
 36 bytes leaked in 2 chunks




 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   majord...@openssl.org
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


dynamic locks don't get cleaned up

2010-08-17 Thread Jeff Saremi

I apologize if this shows up more than once. I've been having problems
sending emails out, all day.

 First I encountered this with valgrind but then I decided to have
openssl print the leaks and it was also confirmed.
I have reduced my code to the following two lines. Prior to this if
course initilization of openssl and then the cleanup. Either there's a
call that I'm missing or the the dynamic locks don't get cleaned up upon
exit. Looking at the code in cryptlib.c, i don't see anywhere freeing up
the memory allocated to the following stacks:

static STACK_OF(OPENSSL_STRING) *app_locks=NULL;
static STACK_OF(CRYPTO_dynlock) *dyn_locks=NULL;

And here's my sample code:
int l = CRYPTO_get_new_dynlockid();
CRYPTO_destroy_dynlockid(l);

Before this I have a bunch of lines like:
CRYPTO_malloc_debug_init();
CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);

SSL_library_init();
OpenSSL_add_all_digests();
CRYPTO_set_id_callback(..);
CRYPTO_set_locking_callback(...);
CRYPTO_set_dynlock_create_callback(...);
CRYPTO_set_dynlock_lock_callback(...);
CRYPTO_set_dynlock_destroy_callback(...);

And at the end of the code I have something like:
CRYPTO_set_id_callback(NULL);
CRYPTO_set_locking_callback(NULL);
CRYPTO_set_dynlock_create_callback(NULL);
CRYPTO_set_dynlock_lock_callback(NULL);
CRYPTO_set_dynlock_destroy_callback(NULL);

ENGINE_cleanup();
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
ERR_free_strings();
OBJ_NAME_cleanup(-1);
ERR_remove_thread_state(NULL);
SSL_free_comp_methods();
CRYPTO_mem_leaks_fp(stderr);

As you can see I have included every cleanup call I could find.
Running the code produces the following output:
[19:49:10]   188 file=stack.c, line=125, thread=19596, number=20,
address=08DF0E50
[19:49:10]   189 file=stack.c, line=127, thread=19596, number=16,
address=08DF0F78
36 bytes leaked in 2 chunks




__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


My custom engine_finish method does not get called through ENGINE_finish

2010-08-13 Thread Jeff Saremi
 I'm trying to use my custom engine however I cannot get it to clean up
nicely.
For the initialization i used the sample in openssl ENGINE(3) documentation.

Here's how it goes:

ENGINE *loadEngine()
{
ENGINE *e;
e = ENGINE_by_id(MY_ENGINE_ID);
if(!e)
ENGINE_load_my();
e = ENGINE_by_id(MY_ENGINE_ID); /* try again */
if(!e)
/* the engine isn't available */
return NULL;
if(!ENGINE_init(e)) {
/* the engine couldn't initialise, release 'e' */
ENGINE_free(e);
return NULL;
}
ENGINE_set_default(e, ENGINE_METHOD_ALL);
return e;
}
void unloadEngine(ENGINE *e)
{
/* Release the functional reference from ENGINE_init() */
ENGINE_finish(e);
/* Release the structural reference from ENGINE_by_id() */
ENGINE_free(e);
/* ENGINE_cleanup();  my engine_finish method does not get
called unless I include this line */
}
void testKeyGen()
{
   /* some openssl initialization code such as loading ciphers,
algorithms, existing engines, establishing dynamic locks and so on */

ENGINE *e = loadEngine();
ASSERT(e, could not create the engine\n);
EVP_PKEY *pkey = NULL;
genPKey(e, pkey); /* some calls to EVP_PKEY_CTX_new_id,
EVP_PKEY_keygen and so on */
ASSERT(pkey, could not generate PKEY\n);

/* so far so good */
if(pkey)
EVP_PKEY_free(pkey);

unloadEngine(e);
   /* at the end of this I have unfreed memory (the dynamic lock I
created in my engine because my_finish was not called */
}

And here's my engine initialization and deinit routines. I stepped
through the code in ENGINE_finish() and realized that the following line
(to_return = e-finish(e); ) does not get executed because apparently
the ref count is not zero:

* file openssl/crypto/engine/eng_init.c  **
int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers)
{
if((e-funct_ref == 0)  e-finish)
{
if(unlock_for_handlers)
CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
to_return = e-finish(e);
if(unlock_for_handlers)
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if(!to_return)
return 0;
...
}

* continuation of my code -- my engine init routines  *

static int my_init(ENGINE *e)
{
ERR_load_MY_strings();
my_lock_id = CRYPTO_get_new_dynlockid();
...
return 1;
}
static int my_finish(ENGINE *e)
{
ERR_unload_MY_strings();
CRYPTO_destroy_dynlockid(my_lock_id);
return 1;
}
static int bind_helper(ENGINE *e)
{
...
if (!ENGINE_set_id(e, MY_ENGINE_ID)
|| !ENGINE_set_name(e, MY_ENGINE_NAME)
|| !ENGINE_set_destroy_function(e, my_destroy)
|| !ENGINE_set_init_function(e, my_init)
|| !ENGINE_set_finish_function(e, my_finish)
...
return 0;
return 1;
}
static ENGINE *engine_my(void)
{
ENGINE *ret = ENGINE_new();
if (!ret)
return NULL;
if (!bind_helper(ret))
{
ENGINE_free(ret);
return NULL;
}
return ret;
}
void ENGINE_load_my(void)
{
ENGINE *toadd = engine_my();
if (!toadd)
return;
ENGINE_add(toadd);
ENGINE_free(toadd);
ERR_clear_error();
}





This email contains Morega Systems Inc. Privileged and Confidential information.

Re: My custom engine_finish method does not get called through ENGINE_finish

2010-08-13 Thread Jeff Saremi
 I fixed the problem. I'm listing it here in case someone else runs into
this:

In the loadEngine() I call ENGINE_set_default(). I have to the opposite
when unloading my engine.
Unfortunately, I could not find any ENGINE_unset_default() or
ENGINE_unregister_all() so I had to explicitly unregister my method
pointers. So my new unloadEngine looks like the following:

void unloadEngine(ENGINE *e)
{
ENGINE_unregister_pkey_asn1_meths(e);
ENGINE_unregister_pkey_meths(e);
ENGINE_unregister_RSA(e);

ENGINE_remove(e);
/* Release the functional reference from ENGINE_init() */
   ENGINE_finish(e);
/* Release the structural reference from ENGINE_by_id() */
ENGINE_free(e);
}


On 10-08-13 09:23 AM, Jeff Saremi wrote:
  I'm trying to use my custom engine however I cannot get it to clean up
 nicely.
 For the initialization i used the sample in openssl ENGINE(3) documentation.

 Here's how it goes:

 ENGINE *loadEngine()
 {
 ENGINE *e;
 e = ENGINE_by_id(MY_ENGINE_ID);
 if(!e)
 ENGINE_load_my();
 e = ENGINE_by_id(MY_ENGINE_ID); /* try again */
 if(!e)
 /* the engine isn't available */
 return NULL;
 if(!ENGINE_init(e)) {
 /* the engine couldn't initialise, release 'e' */
 ENGINE_free(e);
 return NULL;
 }
 ENGINE_set_default(e, ENGINE_METHOD_ALL);
 return e;
 }
 void unloadEngine(ENGINE *e)
 {
 /* Release the functional reference from ENGINE_init() */
 ENGINE_finish(e);
 /* Release the structural reference from ENGINE_by_id() */
 ENGINE_free(e);
 /* ENGINE_cleanup();  my engine_finish method does not get
 called unless I include this line */
 }
 void testKeyGen()
 {
/* some openssl initialization code such as loading ciphers,
 algorithms, existing engines, establishing dynamic locks and so on */

 ENGINE *e = loadEngine();
 ASSERT(e, could not create the engine\n);
 EVP_PKEY *pkey = NULL;
 genPKey(e, pkey); /* some calls to EVP_PKEY_CTX_new_id,
 EVP_PKEY_keygen and so on */
 ASSERT(pkey, could not generate PKEY\n);

 /* so far so good */
 if(pkey)
 EVP_PKEY_free(pkey);

 unloadEngine(e);
/* at the end of this I have unfreed memory (the dynamic lock I
 created in my engine because my_finish was not called */
 }

 And here's my engine initialization and deinit routines. I stepped
 through the code in ENGINE_finish() and realized that the following line
 (to_return = e-finish(e); ) does not get executed because apparently
 the ref count is not zero:

 * file openssl/crypto/engine/eng_init.c  **
 int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers)
 {
 if((e-funct_ref == 0)  e-finish)
 {
 if(unlock_for_handlers)
 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 to_return = e-finish(e);
 if(unlock_for_handlers)
 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
 if(!to_return)
 return 0;
 ...
 }

 * continuation of my code -- my engine init routines  *

 static int my_init(ENGINE *e)
 {
 ERR_load_MY_strings();
 my_lock_id = CRYPTO_get_new_dynlockid();
 ...
 return 1;
 }
 static int my_finish(ENGINE *e)
 {
 ERR_unload_MY_strings();
 CRYPTO_destroy_dynlockid(my_lock_id);
 return 1;
 }
 static int bind_helper(ENGINE *e)
 {
 ...
 if (!ENGINE_set_id(e, MY_ENGINE_ID)
 || !ENGINE_set_name(e, MY_ENGINE_NAME)
 || !ENGINE_set_destroy_function(e, my_destroy)
 || !ENGINE_set_init_function(e, my_init)
 || !ENGINE_set_finish_function(e, my_finish)
 ...
 return 0;
 return 1;
 }
 static ENGINE *engine_my(void)
 {
 ENGINE *ret = ENGINE_new();
 if (!ret)
 return NULL;
 if (!bind_helper(ret))
 {
 ENGINE_free(ret);
 return NULL;
 }
 return ret;
 }
 void ENGINE_load_my(void)
 {
 ENGINE *toadd = engine_my();
 if (!toadd)
 return;
 ENGINE_add(toadd);
 ENGINE_free(toadd);
 ERR_clear_error();
 }





 This email contains Morega Systems Inc. Privileged and Confidential 
 information.



This email contains Morega Systems Inc. Privileged and Confidential information.

Procedure to define and add new lock types?

2010-08-09 Thread Jeff Saremi
 In my engine, i'd like to use a new lock for a set of operations. This
lock is not CRYPTO_LOCK_ENGINE or any other defined ones.
Is there any way in OpenSSL to define a say user lock (type) and then
use CRYPTO_Lock function on it?
What would happen to CRYPTO_NUM_LOCKS? would that increase by way of
defining and adding this lock?

thanks
jeff



This email contains Morega Systems Inc. Privileged and Confidential information.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Procedure to define and add new lock types?

2010-08-09 Thread Jeff Saremi
 I think i found the answer to this. The responsibility is lied within
the application.
The app should setup its own list of locks, possibly above and beyond
the CRYPTO_NUM_LOCKS.
And then provide appropriate routines to pass to the following:
CRYPTO_set_locking_callback
CRYPTO_set_dynlock_create_callback
CRYPTO_set_dynlock_lock_callback
CRYPTO_set_dynlock_destroy_callback

The desired lock type is passed in the struct CRYPTO_dynlock_value *
parameter to the cusom dynlock_lock_callback.


On 10-08-09 09:18 AM, Jeff Saremi wrote:
  In my engine, i'd like to use a new lock for a set of operations. This
 lock is not CRYPTO_LOCK_ENGINE or any other defined ones.
 Is there any way in OpenSSL to define a say user lock (type) and then
 use CRYPTO_Lock function on it?
 What would happen to CRYPTO_NUM_LOCKS? would that increase by way of
 defining and adding this lock?

 thanks
 jeff



 This email contains Morega Systems Inc. Privileged and Confidential 
 information.
 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   majord...@openssl.org



This email contains Morega Systems Inc. Privileged and Confidential information.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Frustration with method based on EVP_PKEY_METHOD

2010-07-08 Thread Jeff Saremi
The structure itself is only forward-declared meaning that a programmer
has no way of getting into the actual evp_pkey_method_st and its fields.
Now that would be fine if there were a complete set of methods
EVP_PKEY_meth_* to manipulate the pointers to EVP_PKEY_METHOD. But alas
there's only a few.
For instance I cannot copy one struct to another meaning
EVP_PKEY_meth_copy() is missing. Note that we do have
EVP_PKEY_asn1_copy() which in many ways behaves the same way as its
counter part.
We can't also get a pointer to an existing function i.e. by calling
EVP_PKEY_meth_get_ctrl(). There are no get methods.

If there's any rationale behind this, I'd love to know that.
thanks
jeff



This email contains Morega Systems Inc. Privileged and Confidential information.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Frustration with method based on EVP_PKEY_METHOD

2010-07-08 Thread Jeff Saremi
OK. Thanks for replying.

On Thu, 2010-07-08 at 18:59 +0200, Dr. Stephen Henson wrote:
 The only current example of an external EVP_PKEY_METHOD (in the gost ENGINE)
 implements everything from scratch. 
 
 It is perfectly reasonable for another implementation to copy existing methods
 or intercept them. The fact you can't do that with the current API is an
 omission, sorry about that. I'll look into fixing that.
 
 Steve.
 --
 Dr Stephen N. Henson. OpenSSL project core developer.
 Commercial tech support now available see: http://www.openssl.org




This email contains Morega Systems Inc. Privileged and Confidential information.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


ENGINE: where are corresponding 'save' methods for ENGINE_set_load_pub/privatekey_function?

2010-07-04 Thread Jeff Saremi
How does one provide own engine functions for saving public and private
keys?
thanks
jeff



This email contains Morega Systems Inc. Privileged and Confidential information.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


ENGINE: RSA_METHOD-rsa_keygen does not behave like other function pointers

2010-07-04 Thread Jeff Saremi
To avoid having to override every RSA function, I could fill my engine's
custom RSA_METHOD with methods from RSA_PKCS1_SSLeay. Alternatively I
could have my functions wrap the internal OpenSSL functions. For
instance:
int myEngineRsaModExp(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx)
{
  int rc = 0;
  ... 
  // do some custom work here
  // now call internal method
  rc = RSA_PKCS1_SSLeay()-rsa_mod_exp(r0, I, rsa, cts);

  // do some more customized work
  return rc;

}

However, I can't do that with rsa_keygen. For some reason this pointer
is null (actually there could be more of these -- so far I have come
across this one only).

The source code for RSA_generate_key_ex which calls the builtin
rsa_builtin_kegen has a comment including the following:

/* this wrapper would normally be placed in ... the ...
 * implementation would probably be in rsa_eay.c.
 * Nonetheless, is kept here so
 * that we don't introduce a new linker dependency. 

Could this be fixed with so that RSA_PKCS1_SSLeay() has a pointer to the
builtin implementation. Since i don't have access to the original,
declared-as-static method I have to come up unsafe hacks like this (a
very crude version):

int rc = 0;
RSA_METHOD *myEnginesMethod = rsa-meth;
rsa-meth = RSA_null_method();
rc = RSA_generate_key_ex(rsa, bits, e, cb);
rsa-meth = myEnginesMethod;
return rc;



This email contains Morega Systems Inc. Privileged and Confidential information.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: How to free SSL_METHOD structure

2010-06-21 Thread jeff
Well that completely screwed up my plans. Am i glad i looked at this
thread before creating a disaster.

So i was using SSL_METHOD struct to provide a custom implementation of
rsa_mod_exp. And this implementation needed to be provided on a per-need
basis. After your reply, I quickly ran a test and saw all my keys (RSA
structs) been carrying the same change.

What's more disturbing is that I had thought that using app_data field
of the struct I could make the method context aware so it knows where it
was called from (and provide some thread safe mechanics in there).

Is there any way to create unique instances of this struct to possibly
achieve some of the goals above? thanks
jeff

 
 There isn't one. It is a static structure.
 
 Steve.
 --
 Dr Stephen N. Henson. OpenSSL project core developer.




This email contains Morega Systems Inc. Privileged and Confidential information.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: NameConstraints are not being applied (or I don't know how to enforce them?)

2010-06-05 Thread jeff
I tested this openssl 1.0.0. Error 34 is gone now but now error 47 shows
up which shows the name constraint is being applied. However, it's being
applied or verified in a way that I don't understand.
To show you I have simplified the test. Generating only one end
certificate and specifying one very simple name constraint. 
The name constraint is chosen in a way to eliminate an guess work and
unspecified matching requirements.

Here are some relevant output. The test scripts are attached.

Command output:
$ ./testnameconst.sh 2/dev/null
OpenSSL 1.0.0a 1 Jun 2010
error 47 at 0 depth lookup:permitted subtree violation
ERROR: Good cert should have been verified but it didn't

End entity (Good) cert:
Version: 3 (0x2)
Serial Number: 17 (0x11)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, CN=SUB CA
Subject: O=good, CN=Good
X509v3 extensions:
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Key Usage: critical
Digital Signature, Key Encipherment, Key Agreement
X509v3 Extended Key Usage: 
TLS Web Client Authentication


subCA cert:
Version: 3 (0x2)
Serial Number: 1 (0x1)
Signature Algorithm: sha1WithRSAEncryption
Issuer: CN=Root CA, C=US
Validity
Not Before: Jun  5 03:10:07 2010 GMT
Not After : Jun  5 03:10:07 2011 GMT
Subject: C=US, ST=NY, O=SubCa, CN=SubCA

X509v3 extensions:
X509v3 Key Usage: critical
Certificate Sign, CRL Sign
X509v3 Basic Constraints: critical
CA:TRUE, pathlen:0
X509v3 Name Constraints: critical
Permitted:
  DirName: CN = Good, O = good



This email contains Morega Systems Inc. Privileged and Confidential information.# OpenSSL configuration file for NameConstraint Test
#

HOME= .
RANDFILE= $ENV::HOME/.rnd

[ ca ]
default_ca  = CA_default

[ CA_default ]
dir = .
new_certs_dir   = $dir/
crl_dir = $dir/
database= $dir/index
certificate = $dir/rootcacert.pem
serial  = $dir/serial
private_key = $dir/rootcakey.pem
RANDFILE= $dir/.rand
x509_extensions = cert_ext
unique_subject  = no
name_opt= ca_default
cert_opt= ca_default
default_crl_days= 30
default_days= 365
default_md  = sha1
preserve= no
policy  = policy_default
email_in_dn = no
msie_hack   = no
copy_extensions = none

[ policy_default ]
countryName = optional
stateOrProvinceName = optional
organizationName= optional
organizationalUnitName  = optional
commonName  = supplied
emailAddress= optional

[ req ]
default_bits= 1024
default_keyfile = ./rootcakey.pem
default_md  = sha1
prompt  = no
distinguished_name  = root_ca_distinguished_name
string_mask = nombstr

[ root_ca_distinguished_name ]
commonName = Root CA
countryName = US

[ cert_ext ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer:always
basicConstraints = critical,CA:FALSE
keyUsage = critical, keyCertSign, cRLSign
extendedKeyUsage=clientAuth

[ root_ca_ext ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
keyUsage = critical, keyCertSign, cRLSign
basicConstraints = critical,CA:TRUE

[ trusted_ca_ext ]
# Extensions for the Sub CA
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
keyUsage = critical, keyCertSign, cRLSign
basicConstraints = critical,CA:TRUE,pathlen:0
nameConstraints = critical,@name_const_section

[ name_const_section ]
#excluded;dirName=excluded_trust_ca_DN
permitted;dirName=permitted_trust_ca_DN

[ excluded_trust_ca_DN ]
O=bad

[ permitted_trust_ca_DN ]
CN=Good
O=good
# OpenSSL configuration file for NameConstraint Test
#

HOME= .
RANDFILE= $ENV::HOME/.rnd

[ ca ]
default_ca  = SUBCA_default

[ SUBCA_default ]
dir = .
new_certs_dir   = $dir/
crl_dir = $dir/
database= $dir/subcaindex
certificate = $dir/subcacert.pem
serial  = $dir/subcaserial
private_key = $dir/subcakey.pem
RANDFILE= $dir/.rand
x509_extensions = cert_ext
unique_subject  = no
name_opt= ca_default
cert_opt= ca_default
default_crl_days= 30
default_days= 365
default_md  = sha1
preserve= no
policy  = policy_default
email_in_dn = no
msie_hack   = no
copy_extensions = none

[ policy_default ]
countryName = optional
stateOrProvinceName = optional
organizationName= optional
organizationalUnitName  = optional
commonName  = supplied
emailAddress= optional

[ req ]
default_bits= 1024
default_keyfile = ./subcakey.pem
default_md  = sha1
prompt   

Re: NameConstraints are not being applied (or I don't know how to enforce them?)

2010-06-05 Thread jeff
I did a little debugging and managed to fix on my end.
The issue is now resolved. There's nothing wrong with OpenSSL1.0.0's
handling of nameConstraints. It just Rocks!

For those who might run into the same problem i'll explain more.

Debugging revealed the problem to be in the following area:

Breakpoint 2, nc_dn (nm=0x8269a98, base=0x8268b38) at
v3_ncons.c:378
378 {
(gdb) p nm-canon_enc
$5 = (unsigned char *) 0x826a590 1\r0\v\006\003U\004\n\f
\004good1\r0\v\006\003U\004\003\f\004good
(gdb) p base-canon_enc
$6 = (unsigned char *) 0x826aab0 1\r0\v\006\003U\004\003\f
\004good1\r0\v\006\003U\004\n\f\004good
(gdb) n
386 if (memcmp(base-canon_enc, nm-canon_enc,
base-canon_enclen))
(gdb) n
387 return X509_V_ERR_PERMITTED_VIOLATION;
(gdb) 

The above shows that the provided DN and the allowed one seem out of
order. Look at $5 and $6.
So i took another look at the target cert and the nameConstraint in the
signing cert:
   X509v3 Name Constraints: critical
 Permitted:
   DirName: CN = Good, O = good


 Subject: O=good, CN=Good

Look how the order of CN and O are transposed in these entries. 
Now whether that is legitimate or not it remains.
Regardless, as soon as I fixed my nameConstraint to:
[ permitted_trust_ca_DN ]
O=good
CN=Good
The problem went away.

I revised my script to have a good test case and a failed one.
The latest are attached for those who may benefit from this.
Thanks to Victor Duchovni and Dr. Stephen Henson for providing guidance and 
help.
jeff


On Sat, 2010-06-05 at 20:27 -0400, jeff wrote:
 I tested this openssl 1.0.0. Error 34 is gone now but now error 47 shows
 up which shows the name constraint is being applied. However, it's being
 applied or verified in a way that I don't understand.
 To show you I have simplified the test. Generating only one end
 certificate and specifying one very simple name constraint. 
 The name constraint is chosen in a way to eliminate an guess work and
 unspecified matching requirements.
 
 Here are some relevant output. The test scripts are attached.
 
 Command output:
 $ ./testnameconst.sh 2/dev/null
 OpenSSL 1.0.0a 1 Jun 2010
 error 47 at 0 depth lookup:permitted subtree violation
 ERROR: Good cert should have been verified but it didn't
 
 End entity (Good) cert:
 Version: 3 (0x2)
 Serial Number: 17 (0x11)
 Signature Algorithm: sha1WithRSAEncryption
 Issuer: C=US, CN=SUB CA
 Subject: O=good, CN=Good
 X509v3 extensions:
 X509v3 Basic Constraints: critical
 CA:FALSE
 X509v3 Key Usage: critical
 Digital Signature, Key Encipherment, Key Agreement
 X509v3 Extended Key Usage: 
 TLS Web Client Authentication
 
 
 subCA cert:
 Version: 3 (0x2)
 Serial Number: 1 (0x1)
 Signature Algorithm: sha1WithRSAEncryption
 Issuer: CN=Root CA, C=US
 Validity
 Not Before: Jun  5 03:10:07 2010 GMT
 Not After : Jun  5 03:10:07 2011 GMT
 Subject: C=US, ST=NY, O=SubCa, CN=SubCA
 
 X509v3 extensions:
 X509v3 Key Usage: critical
 Certificate Sign, CRL Sign
 X509v3 Basic Constraints: critical
 CA:TRUE, pathlen:0
 d
 
 
 
 This email contains Morega Systems Inc. Privileged and Confidential 
 information.




This email contains Morega Systems Inc. Privileged and Confidential information.# OpenSSL configuration file for NameConstraint Test
#

HOME= .
RANDFILE= $ENV::HOME/.rnd

[ ca ]
default_ca  = CA_default

[ CA_default ]
dir = .
new_certs_dir   = $dir/
crl_dir = $dir/
database= $dir/index
certificate = $dir/rootcacert.pem
serial  = $dir/serial
private_key = $dir/rootcakey.pem
RANDFILE= $dir/.rand
x509_extensions = cert_ext
unique_subject  = no
name_opt= ca_default
cert_opt= ca_default
default_crl_days= 30
default_days= 365
default_md  = sha1
preserve= no
policy  = policy_default
email_in_dn = no
msie_hack   = no
copy_extensions = none

[ policy_default ]
countryName = optional
stateOrProvinceName = optional
organizationName= optional
organizationalUnitName  = optional
commonName  = supplied
emailAddress= optional

[ req ]
default_bits= 1024
default_keyfile = ./rootcakey.pem
default_md  = sha1
prompt  = no
distinguished_name  = root_ca_distinguished_name
string_mask = nombstr

[ root_ca_distinguished_name ]
commonName = Root CA
countryName = US

[ cert_ext ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer:always

Re: NameConstraints are not being applied (or I don\'t know how to enforce them?)

2010-06-04 Thread jeff
I would expect such constraints to only apply when
certificates are
being *verified*. There seems to be little point in preventing 
a CA
from attempting to sign violating certificates.

Yes I later tried to verify and I still got no complaints.

Does OpenSSL trust chain validation include any checks on name 
constraints?


If there is an additional step that i need to apply for this verification to 
happen then i don't know that and I'd appreciate if you detailing that please.
thanks.




This email contains Morega Systems Inc. Privileged and Confidential information.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: NameConstraints are not being applied (or I don't know how to enforce them?)

2010-06-04 Thread jeff
I tried the following and it created more interesting results.
It now fails on the good certificate -- the one that matches the
nameConstraint.
The error it returns is: 
error 34 at 1 depth lookup:unhandled critical extension

I revised the cnf file to make sure it didn't include the name
constraint and ran the test again and it succeeded.
I then ran a verify on the Sub-CA certificate itself. Even that fails.

This shows that either my forumlation of the constraint is wrong or for
some other reason, the name constraint is being applied where it
shouldn't.

The updated script and config file are enclosed.
jeff

On Fri, 2010-06-04 at 11:20 +0200, Dr. Stephen Henson wrote:

 Try this instead:
 
 openssl verify -CAfile root.pem -untrusted cas.pem badcert.pem
 
 Where root.pem contains the root CA only and cas.pem is a concatenation of
 any intermediate CAs.
 
 Steve.
 --
 Dr Stephen N. Henson. OpenSSL project core developer.
 Commercial tech support now available see: http://www.openssl.org
 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   majord...@openssl.org




This email contains Morega Systems Inc. Privileged and Confidential information.# OpenSSL configuration file for NameConstraint Test
#

HOME= .
RANDFILE= $ENV::HOME/.rnd

[ ca ]
default_ca  = CA_default

[ CA_default ]
dir = .
new_certs_dir   = $dir/
crl_dir = $dir/
database= $dir/index
certificate = $dir/rootcacert.pem
serial  = $dir/serial
private_key = $dir/rootcakey.pem
RANDFILE= $dir/.rand
x509_extensions = cert_ext
unique_subject  = no
name_opt= ca_default
cert_opt= ca_default
default_crl_days= 30
default_days= 365
default_md  = sha1
preserve= no
policy  = policy_default
email_in_dn = no
msie_hack   = no
copy_extensions = none

[ policy_default ]
countryName = optional
stateOrProvinceName = optional
organizationName= optional
organizationalUnitName  = optional
commonName  = supplied
emailAddress= optional

[ req ]
default_bits= 1024
default_keyfile = ./rootcakey.pem
default_md  = sha1
prompt  = no
distinguished_name  = root_ca_distinguished_name
string_mask = nombstr

[ root_ca_distinguished_name ]
commonName = Root CA
countryName = US

[ cert_ext ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer:always
basicConstraints = critical,CA:FALSE
keyUsage = critical, keyCertSign, cRLSign
extendedKeyUsage=clientAuth

[ root_ca_ext ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
keyUsage = critical, keyCertSign, cRLSign
basicConstraints = critical,CA:TRUE

[ trusted_ca_ext ]
# Extensions for the Sub CA
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
keyUsage = critical, keyCertSign, cRLSign
basicConstraints = critical,CA:TRUE,pathlen:0
nameConstraints = critical,@name_const_section

[ name_const_section ]
excluded;dirName=excluded_trust_ca_DN
permitted;dirName=permitted_trust_ca_DN

[ excluded_trust_ca_DN ]
O=bad

[ permitted_trust_ca_DN ]
O=good


testnameconst.sh
Description: application/shellscript


Re: NameConstraints are not being applied (or I don't know how to enforce them?)

2010-06-04 Thread jeff
yes it's 0.98
I'll do a test with 1.0 before Monday and i'll let everyone know



This email contains Morega Systems Inc. Privileged and Confidential information.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


NameConstraints are not being applied (or I don't know how to enforce them?)

2010-06-03 Thread jeff
I have an example, detailed below, that specifies permitted and excluded
subtrees for a sub-CA. Later it uses the sub-CA cert to sign certificate
requests adhering to and violating the name constraints both, even
though the nameConstraints are marked as critical.
Is this OpenSSL misbehaving or did I miss something when creating the
sub-CA certificate or issuing the user certificate?
thanks/jeff

openssl.cnf lines for Root CA when issued the sub-CA's certificate:
...
nameConstraints = critical,@name_const_section
[ name_const_section ]
excluded;dirName=excluded_DN
permitted;dirName=permitted_DN

[ excluded_DN ]
O=bad

[ permitted_DN ]
O=good

Print out of the sub-CA's cert (trustedcacert.pem):
Certificate Details:
Serial Number: 22 (0x16)
Validity
Not Before: Jun  3 13:13:36 2010 GMT
Not After : Jun  3 13:13:36 2011 GMT
Subject:
countryName   = US
stateOrProvinceName   = NY
organizationName  = AcmeCorp
commonName= AcmeCorp
X509v3 extensions:
...
X509v3 Key Usage: critical
Certificate Sign, CRL Sign
X509v3 Basic Constraints: critical
CA:TRUE, pathlen:0
X509v3 Name Constraints: critical
Permitted:
  DirName: O = good
Excluded:
  DirName: O = bad

Commands issued to create CSRs and sign them with the sub-CA's cert:

# signing the good cert req
openssl req -new -newkey rsa:2048 -nodes -keyout goodkey.pem \
-sha256 -subj /O=good+CN=Good\/Instance
-multivalue-rdn \
 goodcsr.pem
openssl x509 -CA trustedcacert.pem -CAkey trustedcakey.pem \
-days 365 -req -in goodcsr.pem -set_serial 2 -out
goodcert.pem


# signing the bad cert req
openssl req -new -newkey rsa:2048 -nodes -keyout badkey.pem \
-sha256 -subj /O=bad+CN=Bad\/Instance -multivalue-rdn
\ 
 badcsr.pem
openssl x509 -CA trustedcacert.pem -CAkey trustedcakey.pem \
-days 365 -req -in badcsr.pem -set_serial 3 -out
badcert.pem

Print out of the created badcert.pem:
Certificate:
Data:
Version: 1 (0x0)
Serial Number: 3 (0x3)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=NY, O=AcmeCorp, CN=AcmeCorp
Validity
Not Before: Jun  3 13:13:38 2010 GMT
Not After : Jun  3 13:13:38 2011 GMT
Subject: O=bad, CN=Bad/Instance
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (2048 bit)



This email contains Morega Systems Inc. Privileged and Confidential information.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Q: Ramifications of creating new X509-Store and setting it in SSL_CTX while SSL_accept's being done

2010-05-14 Thread Jeff Saremi
In order to update the CRLs in our server socket and due to seemingly
lack of any CRL update methods, I decided to create new X509_STOREs and
set them in the SSL_CTX every time there's a change in the CRL list.

I'd like to know the effects of that if at the same time new SSLs being
created, setup for accept(), or  accepting.

Are there any specific synchronization primitives i should be aware of
when doing this.

Thanks

Je

 




This email contains Morega Systems Inc. Privileged and Confidential information.

validating signature against cert

2009-10-01 Thread Jeff Strope
Hi all...I'm having a bit of trouble with openssl and I was hoping 
someone here might point me in the right direction.


I've been given an X509 signing certificate that I’m storing in base64 
format along with a SHA1 w/ RSA signature. How do I verify that 
signature against the signing certificate via openssl? Any help would be 
appreciated.


Best,

Jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


SSL_get_peer_certificate fails with 0.9.8k, works with 0.9.8j

2009-05-01 Thread Jeff Davey
Hi,

I recently ran into an issue with OpenSSL 0.9.8k returning NULL when calling
SSL_get_peer_certificate() after a successful handshake. The issue doesn't
occur every time, but often enough.

I reverted to OpenSSL 0.9.8j, and haven't been able to replicate the
problem. To verify, I again went 0.9.8k and the issue cropped up right away.

I'm using the command on a custom SSL server, which has set VERIFY_PEER |
VERIFY_FAIL_IF_NO_PEER_CERT in the SSL_CTX. Also, I am trying to get the
peer cert after succesfully completing SSL_do_handshake, and additionally
reading some initial connection data from the client.

SSL_CTX is setup to verify against a specific chain, and not default
locations.

All sockets are non-blocking, using libevent in place of select.

Also, statically linking against OpenSSL.

I'm compiling OpenSSL on Ubuntu 64bit 9.04 with ./config no-idea no-comp
using gcc 4.3.3

I tried doing a quick diff between 0.9.8j, and 0.9.8k, but didn't see
anything obvious.

Any ideas?

Thanks,

Jeff


OpenSSL 0.9.8h and Win64A

2008-06-06 Thread Melnick, Jeff
I've been trying to build OpenSSL 0.9.8h for WIN64A.

I have Visual Studio 2005, SP1 and the Server 2008 SDK (6.1) on 32 bit
Windows XP.

 

I run:

perl Configure VC-WIN64A

ms\do_win64a

nmake -f ms\ntdll.mak

 

I get a ton of errors from ms\uptable.asm.  For example:

ms\uptable.asm(45) : error A2024: invalid operand size for
instruction

ms\uptable.asm(62) : error A2024: invalid operand size for instruction 

ms\uptable.asm(32) : error A2006: undefined symbol : r9

ms\uptable.asm(33) : error A2006: undefined symbol : r8

ms\uptable.asm(34) : error A2006: undefined symbol : rdx

ms\uptable.asm(35) : error A2006: undefined symbol : rcx

 

I'm beginning to think that this needs to be build on a 64 bit version of
Windows.

 

Has anyone seen this?

What might I need to do differently?

Thank you for the help.

 



Jeff Melnick
Sr Engineer

  http://www.securecomputing.com/ 

Your trusted source for enterprise security(tm) 
www.securecomputing.com http://www.securecomputing.com/ 
NASDAQ: SCUR

+1 (925) 288-4154 (Direct Phone)
+1 (651) 307-1471 (Mobile Phone)
+1 (925) 827-2593 (Fax)
[EMAIL PROTECTED]

Secure Computing Corporation
1855 Gateway Boulevard
Suite 200
Concord, CA 94520
USA

The information contained in this email message may be privileged,
confidential and protected from disclosure. If you are not the intended
recipient, any review, dissemination, distribution or copying is strictly
prohibited. If you have received this email message in error, please notify
the sender by reply email and delete the message and any attachments.

 

 

image001.gif

sk_value causes seg fault

2008-04-08 Thread Jeff Amiel
Openssl team,

I've had a recurring problem utilizing postgresql over SSL on our Solaris 
platform (had a similar
problem on FreeBSD but one thing at a time).

Essentially, when client's connect and read/write using SSL to our database, 
the result is a
segfault.

It was happening predominantly with our replication, so we stopped using ssl 
and instead tunneled
the traffic over a secure ssh connection.
There was no doubt that the issue was occurring in the SSL layers because if we 
disabled, problem
went away...if we re enabled, problem re-occurred.
(http://archives.postgresql.org/pgsql-general/2007-08/msg01911.php)

Today, issue cropped up again...same stack trace:

#0  0xfee8ec23 in sk_value () from /usr/local/ssl/lib/libcrypto.so.0.9.8 
#1  0xfef5b05b in ssl3_output_cert_chain () from 
/usr/local/ssl/lib/libssl.so.0.9.8 
#2  0x in ?? ()

This appears to be version 0.9.8e

Obviously the problem could be in the way that postgresql is interfacing with 
libssland I am
working with postgresql users/committers to help troubleshoot but I thought 
that maybe the openssl
folks could help.

Any thoughts or suggestions would be appreciated.











  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: sk_value causes seg fault

2008-04-08 Thread Jeff Amiel

--- [EMAIL PROTECTED] wrote:

 
 #0  0xfee8ec23 in sk_value () from /usr/local/ssl/lib/libcrypto.so.0.9.8 
 #1  0xfef5b05b in ssl3_output_cert_chain () from 
 /usr/local/ssl/lib/libssl.so.0.9.8 
 #2  0x in ?? ()
 
 This appears to be version 0.9.8e

Sorry for wasting your time
Looks like I was using the 0.9.8e libraries but compiling with the 0.9.7d 
headers.
That can't be good.






  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


How to enable ssl?

2008-03-25 Thread Jeff Andrews
Hey i was wondering how i enable ssl to cover all my ports and such. I 
downloaded and installed but i want to cover all my ports with it and i dont 
know how to enable it. Is there a GUI i can use?


Thanks,


Jeff

   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

RE: newer versions of openssl via yum

2008-02-13 Thread Jeff
Victor,

Thanks for the reply. openssl version reports:

OpenSSL 0.9.8a 11 Oct 2005

Looks like I should take this up with the folks at Fedora...

Best,

-Jeff

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Victor Duchovni
Sent: Wednesday, February 13, 2008 6:30 AM
To: openssl-users@openssl.org
Subject: Re: newer versions of openssl via yum

On Tue, Feb 12, 2008 at 08:34:20PM -0500, Jeff wrote:

 I have some Fedora 5 systems on which I'd like to upgrade openssl. I'm
 currently running 0.9.8a-5.4, which is reported by yum as the latest
 version:
 

Many O/S vendors backport bugfixes from OpenSSL patch releases,
so, for example, instead of updating to 0.9.8g, they will import just the
bug fixes from 0.9.8g back to the base 0.9.8a version.

I don't blame them. The OpenSSL patch releases are hybrid patch and
feature releases, and distributions want a stable feature-set at a
particular release level.

It could also be as simple as wanting to keep the package name the same.

What does openssl version report? If that also reports 0.9.8a,
then most likely the vendor backports fixes. Sadly, in that case, one
can't tell at a glance which OpenSSL patch level a vendor release like
0.9.8-5.4 corresponds to.

-- 
Viktor.
__
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]


newer versions of openssl via yum

2008-02-12 Thread Jeff
I have some Fedora 5 systems on which I'd like to upgrade openssl. I'm
currently running 0.9.8a-5.4, which is reported by yum as the latest
version:

 yum list openssl

Installed Packages
openssl.i686 0.9.8a-5.4 installed
Available Packages
openssl.i386 0.9.8a-5.4 updates

 yum list updates openssl

(Nothing returned)


Are openssl updates no longer available via yum? Or am I just being a clod?

Thanks!

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


CryptoSwift 200 PCI Card Errors

2007-08-25 Thread Jeff
Hello,

I've been trying to get this card, Rainbow CryptoSwift 200, to work with 
openssl without any success.

When I do openssl speed -engine cswift I get:

DSO support routines:DLFCN_LOAD:could not load the shared 
library:dso_dlfcn.c:100:filename(libswift.so): libswift.so: cannot open shared 
object file: No such file or directory
DSO support routines:DSO_LOAD:could not load the shared library:dso_lib.c:244:
cswift engine:CSWIFT_INIT:not loaded:e_cswift.c:397:
engine routines:ENGINE_TABLE_REGISTER:init failed:eng_table.c:161:

I typed that manually, so excuse any errors if there are any. I'm using today's 
snapshot of openssl.

Any idea of what I'm doing wrong? Thanks.

   
-
Moody friends. Drama queens. Your life? Nope! - their life, your story.
 Play Sims Stories at Yahoo! Games. 

Re: CryptoSwift 200 PCI Card Errors

2007-08-25 Thread Jeff
Thanks...
My libcswift.so is in /usr/local/ssl/lib/engines
I set LD_LIBRARY_PATH, OPENSSL_ENGINES, and SHLIB_PATH to that path directory 
and still get the same error.

One more thing, I've tried several running the openssl config script with 
different options to get it to work.  Using shared builds the libraries like 
libcswift.so, but openssl engine only lists engines when you compile it with 
no-shared.


Marek Marcola wrote: Hello,
 I've been trying to get this card, Rainbow CryptoSwift 200, to work
 with openssl without any success.
 
 When I do openssl speed -engine cswift I get:
 
 DSO support routines:DLFCN_LOAD:could not load the shared
 library:dso_dlfcn.c:100:filename(libswift.so): libswift.so: cannot
 open shared object file: No such file or directory
 DSO support routines:DSO_LOAD:could not load the shared
 library:dso_lib.c:244:
 cswift engine:CSWIFT_INIT:not loaded:e_cswift.c:397:
 engine routines:ENGINE_TABLE_REGISTER:init failed:eng_table.c:161:
 
 I typed that manually, so excuse any errors if there are any. I'm
 using today's snapshot of openssl.
You should find in your system library libcswift.so
and set proper environment variable for your system
(LD_LIBRARY_PATH or SHLIB_PATH) to directory where
this library exits.

Best regards,
-- 
Marek Marcola 

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


   
-
Building a website is a piece of cake. 
Yahoo! Small Business gives you all the tools to get online.

Re: CryptoSwift 200 PCI Card Errors

2007-08-25 Thread Jeff
Ok thanks, atleast I know where I need to go from here...

I've contacted SafeNet about it, and all I was able to get from them was the 
source for cspci.so... I'm not sure what cspci.so is for as there's no 
documentation for the card.

Now I'll try and find libswift.so somewhere.

Richard Levitte wrote: In message [EMAIL PROTECTED] on Sat, 25 Aug 2007 
16:51:42 -0700 (PDT), Jeff  said:

dvdrom_box Ok, so I guess no-shared is the option I should be using.
dvdrom_box 
dvdrom_box And I'm entering -engine cswift, the error message says it
dvdrom_box can't find libswift.so.  OpenSSL creates a library named
dvdrom_box libcswift.so, but there actually isn't a libswift.so
dvdrom_box anywhere on the system.  I tried just renaming it, but the
dvdrom_box errors I get from that make me think that they're not
dvdrom_box interchangeable.

Oh, my bad.  It's been a long time since I've dealt with this.

The CryptoSwift card has a library of its own which is used by the
OpenSSL engine.  THAT library is correctly called libswift.so, and
that's the library that OpenSSL (or more correctly, the cswift engine)
can't find.

So, in short, with engines as shared libraries, what happens is that
OpenSSL loads libcswift.so, which in turn loads libswift.so.  The
messages you get actually show that libcswift.so WAS correctly loaded,
but that libswift.so (which, I repeat, should be distributed by the
card maker) isn't.

Cheers,
Richard

dvdrom_box Richard Levitte wrote: In message [EMAIL PROTECTED] on Sat, 25 
Aug 2007 16:17:38 -0700 (PDT), Jeff  said:
dvdrom_box 
dvdrom_box dvdrom_box Thanks...
dvdrom_box dvdrom_box My libcswift.so is in /usr/local/ssl/lib/engines
dvdrom_box dvdrom_box I set LD_LIBRARY_PATH, OPENSSL_ENGINES, and SHLIB_PATH 
to
dvdrom_box dvdrom_box that path directory and still get the same error.
dvdrom_box 
dvdrom_box I'm noticing that the messages you list talk about libswift.so, not
dvdrom_box libcswift.so.  Could it be that you said -engine swift rather than
dvdrom_box -engine cswift?
dvdrom_box 
dvdrom_box dvdrom_box One more thing, I've tried several running the openssl
dvdrom_box dvdrom_box config script with different options to get it to work.
dvdrom_box dvdrom_box Using shared builds the libraries like libcswift.so, 
but
dvdrom_box dvdrom_box openssl engine only lists engines when you compile it
dvdrom_box dvdrom_box with no-shared.
dvdrom_box 
dvdrom_box That's because in no-shared, all available engines are built in 
and
dvdrom_box pre-loaded, while in shared, they aren't built in, and thus 
require
dvdrom_box a little more fiddling to get loaded, and thereby listable.  I don't
dvdrom_box remember the details for the moment, I'm sure someone else can fill 
in
dvdrom_box unless I get back to you about it.
dvdrom_box 
dvdrom_box dvdrom_box Marek Marcola wrote: Hello,
dvdrom_box dvdrom_box  I've been trying to get this card, Rainbow 
CryptoSwift 200, to work
dvdrom_box dvdrom_box  with openssl without any success.
dvdrom_box dvdrom_box  
dvdrom_box dvdrom_box  When I do openssl speed -engine cswift I get:
dvdrom_box dvdrom_box  
dvdrom_box dvdrom_box  DSO support routines:DLFCN_LOAD:could not load the 
shared
dvdrom_box dvdrom_box  library:dso_dlfcn.c:100:filename(libswift.so): 
libswift.so: cannot
dvdrom_box dvdrom_box  open shared object file: No such file or directory
dvdrom_box dvdrom_box  DSO support routines:DSO_LOAD:could not load the 
shared
dvdrom_box dvdrom_box  library:dso_lib.c:244:
dvdrom_box dvdrom_box  cswift engine:CSWIFT_INIT:not loaded:e_cswift.c:397:
dvdrom_box dvdrom_box  engine routines:ENGINE_TABLE_REGISTER:init 
failed:eng_table.c:161:
dvdrom_box dvdrom_box  
dvdrom_box dvdrom_box  I typed that manually, so excuse any errors if there 
are any. I'm
dvdrom_box dvdrom_box  using today's snapshot of openssl.
dvdrom_box dvdrom_box You should find in your system library libcswift.so
dvdrom_box dvdrom_box and set proper environment variable for your system
dvdrom_box dvdrom_box (LD_LIBRARY_PATH or SHLIB_PATH) to directory where
dvdrom_box dvdrom_box this library exits.

-
Please consider sponsoring my work on free software.
See http://www.free.lp.se/sponsoring.html for details.

-- 
Richard Levitte [EMAIL PROTECTED]
http://richard.levitte.org/

When I became a man I put away childish things, including
 the fear of childishness and the desire to be very grown up.
  -- C.S. Lewis


   
-
Be a better Heartthrob. Get better relationship answers from someone who knows.
Yahoo! Answers - Check it out. 

ip changes prevent ssl

2006-09-02 Thread jeff sacksteder
I have a server on a dynamic ip address. If the ip address changes I can no longer establish connections. Although my certs refer to a dns name rather than an ip, if the dns is updated to reflect the new address, ssl fails. If the application is restarted, everything works with no changes. It appears that the application does a name lookup at process startup and uses the ip address found persistantly somehow, rather than doing the lookup at the time the connection is attempted. 
Why does this happen and how can I correct this behaviour?


Question on error creating server key

2006-03-24 Thread Jeff Gross
Hi, 

I'm new to all this, thank God I found this forum

When I build the server key using command :  build-key-server server

I keep getting the following error:

Error opening CA private key C:\Program Files\OpenVPN\easy-rsa\keys/ca.key
2648:error:0200107B:system library:fopen:Unknown 
error:.\crypto\bio\bss_file.c:278:fopen('C:\Program 
Files\OpenVPN\easy-rsa\keys/ca.key','rb')
2648:error:20074002:BIO routines:FILE_CTRL:system 
lib:.\crypto\bio\bss_file.c:280:
unable to load CA private key
Could Not Find C:\Program Files\OpenVPN\easy-rsa\keys\*.old

I've set the paths using these statements in the batch file:

set KEY_DIR=C:\Program Files\OpenVPN\easy-rsa\keys
set KEY_CONFIG=C:\Program Files\OpenVPN\easy-rsa\openssl.cnf

What's the deal with bss_file.c?  Is this supposed to be on my windows2000 
server box?

Am I forgetting something?  
I've been screwing around with this for a day and a half. 

Somebody please help!

Thanks.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


RE: Question on error creating server key

2006-03-24 Thread Jeff Gross
Yes, I'm ironing it out now. 

One problem seems to be the path statements under c:\program Files
No matter how I format it, it's placing quotes C:\Program
Files\Openvpn\..
So I just reinstalled the package to the root of c, now I'm at
c:\Openvpn\Easy-Rsa ,and things are going much smoother.

The other issue is definitely my lack of understanding of the
openssl.cnf file.
That too I'm starting to catch onto. 

Everyone's suggestions have helped tremendously.  

Thanks.

*/Jeff/*


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Dr. Stephen Henson
Sent: Friday, March 24, 2006 1:40 PM
To: openssl-users@openssl.org
Subject: Re: Question on error creating server key


On Fri, Mar 24, 2006, Jeff Gross wrote:

 Hi, 
 
 I'm new to all this, thank God I found this forum
 
 When I build the server key using command :  build-key-server
server
 
 I keep getting the following error:
 
 Error opening CA private key C:\Program
Files\OpenVPN\easy-rsa\keys/ca.key
 2648:error:0200107B:system library:fopen:Unknown
error:.\crypto\bio\bss_file.c:278:fopen('C:\Program
Files\OpenVPN\easy-rsa\keys/ca.key','rb')
 2648:error:20074002:BIO routines:FILE_CTRL:system
lib:.\crypto\bio\bss_file.c:280:
 unable to load CA private key
 Could Not Find C:\Program Files\OpenVPN\easy-rsa\keys\*.old
 
 I've set the paths using these statements in the batch file:
 
 set KEY_DIR=C:\Program Files\OpenVPN\easy-rsa\keys
 set KEY_CONFIG=C:\Program Files\OpenVPN\easy-rsa\openssl.cnf
 
 What's the deal with bss_file.c?  Is this supposed to be on my
windows2000 server box?
 
 Am I forgetting something?  
 I've been screwing around with this for a day and a half. 
 
 Somebody please help!
 

Well it looks like you are using some other package (OpenVPN?) which has
its
own custom batch files which aren't working properly.

That bss_file.c is just to help debug problems. It is indicating the
OpenSSL
source file that produced the error.

The first line is a clue:

 Error opening CA private key C:\Program
Files\OpenVPN\easy-rsa\keys/ca.key

does that file exist? Is it readable?

However since these aren't standard OpenSSL scripts I can't say much
more.
You'd get better results asking in any public forum for the package that
included those scripts.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
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: Question on error creating server key

2006-03-24 Thread Jeff Gross
New error.. this one is related to the definition
of the KEY_DIR.

If I just make the key_dir in vars read:  
set KEY_DIR=C:\OpenVPN\easy-rsa\keys 

I get the following error:

Error opening CA private key C:\OpenVPN\easy-rsa\keysca.key
596:error:02001002:system library:fopen:No such file or
directory:.\crypto\bio\b
ss_file.c:278:fopen('C:\OpenVPN\easy-rsa\keysca.key','rb')
596:error:20074002:BIO routines:FILE_CTRL:system
lib:.\crypto\bio\bss_file.c:280
:
unable to load CA private key

if I copy the ca.key as keysca.key along with the other files
(keysindex, keysca.key, etc)
into the next dir up, (c:\openvpn\easy-rsa)  I can create the server key
successfully.

So somewhere there is some kind of problem with the key_dir variable. 
it's not inserting the backslash after the KEY_DIR definition.
If I put in a backslash, it errors out completely.


I'm not sure if it's in the openssl.cnf or vars.bat

My VARS.BAT:
=snip==
@echo off
set HOME=C:\OpenVPN\easy-rsa
set KEY_CONFIG=C:\OpenVPN\easy-rsa\openssl.cnf

set KEY_DIR=C:\OpenVPN\easy-rsa\keys

set KEY_SIZE=1024
set KEY_COUNTRY=US
set KEY_PROVINCE=PA
set KEY_CITY=Bensalem
set KEY_ORG=company
set [EMAIL PROTECTED]
==snip=

The suspect section of Openssl.cnf:
==snip==
HOME= .
RANDFILE= $ENV::HOME/.rnd

oid_section = new_oids
[ new_oids ]

[ ca ]
default_ca  = CA_default# The default ca section


[ CA_default ]

dir = $ENV::KEY_DIR # Where everything is kept
certs   = $dir  # Where the issued certs are
kept
crl_dir = $dir  # Where the issued crl are kept
database= $dir\index.txt# database index file.
new_certs_dir   = $dir  # default place for new certs.

certificate = $dir\ca.crt   # The CA certificate
serial  = $dir\serial   # The current serial number
crl = $dir\crl.pem  # The current CRL
private_key = $dir\ca.key   # The private key
RANDFILE= $dir\.rand# private random number file

x509_extensions = usr_cert  # The extentions to add to the
cert
=snip=
==

Somehow the KEY_DIR is not getting the backslash inserted or the
where the name of the key to use, the backslash is missing. I'm really
not
sure why it's not working. 



-=Jeff Gross=-
Tucker Industries
3170 Tucker Road
Bensalem, PA 19020
* 215-638-1900 [phone]
* 215-638-3477 [fax]
* 267-496-0350 [cell]
www.tuckerind.com

winmail.dat

Re: Silly CA/certs questions...

2006-02-22 Thread Jeff Wiegley

Kyle,

  That response was AWESOME! Though it did raise more questions
that I'll ask in a later post after I've digested more and tried
to play with some of the stuff you mentioned. (And you're right,
suffering is no reason to be rude. Sorry.)

Georg, I liked the idea for an advanced beginners HOWTO a lot. I
   am willing to organize or help with this.

Mark, I received your rtf document but have not had time to read
  it as my day today is packed with lectures starting soon that
  I haven't prepared for. But I think collaborating on such a
  [advanced beginners HOWTO] project is a fantastic idea. I have
  lots of topics and questions that I think would make for
  good additions to such a really fine document.

I think Kyle's suggestion of a wiki is a really good way to
collaborate on this because we can all make changes and add ideas
to it. This way we can avoid any overall gaps even though each of
us (mostly me) has some gaps in our knowledge.

I would suggest a multipage-wiki that can be hyperlinked so that we
can fork off pages for topics that are too detailed or cover obscure
necessities without that information cluttering up the main/earlier
pages geared towards the true newbs such as myself.

I haven't set up a wiki before. I'll look into later today or
tomorrow afternoon. If anybody has suggestions for what wiki
software to use I'd like to hear them. (My publication expertise
is in the TeX/LaTeX arena, not so much wiki/HTML.)

- Jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Silly CA/certs questions...

2006-02-21 Thread Jeff Wiegley
 cert or do I need a CA root
cert?
  -newreq: What in the world is a certificate request?
   wouldn't that be something you sent verisign in
   order to obtain a certificate? I doubt it, but
   how else is one suppose to interpret creates a new
   certificate request? If it really is a request for
   a certificate then who do I send this request to once
   I create to obtain my desired cert?
  -newca: creates a new CA heirarchy. This sounds good to me.
  But it doesn't create a CA cert? do I need both a
  CA heirarchy and a CA cert? which do I create first?
  Does one need the other?

  -sign
  -signca
  -signcert ugh. ok these seem to sign things. I know my service
certs need to be signed. I know that ssl/tls just
walks back up the signature/cert chain until a trusted
cert is found or a self signed cert is encountered.
I actually do know that my CA cert needs to be
self-signed (if I need a CA cert at all) and needs to
installed in such a way that it is trusted. But I
can't figure that how.

  Oh good... I especially liked this part for -signca...
  This is useful when creating intermediate CA from a root CA.
  Have I just learned that I also need an intermediate CA in addition
  to my root CA??? is a root CA the same as a root CA certificate
  or does it mean a root CA heirarchy??

2) Once I have the CA item figured out how do I create new certs for
   services that are signed by this CA thing?

Please forgive me for being rude. I'm tired, I'm hungry, Got a huge
headache, can't get my sewing machine parts back together into anything
that resembles a sewing machine and I've spent several hours today just
trying to understand the nomenclature of this stuff again. I have spent
probably a hundred or more hours over the past few years trying to
understand this exact same thing and never succeeded, forced to give up
everytime.

Summary:

   Would somebody tell me the exact, complete steps, using only the
openssl program, on unix/linux how to make yourself capable of being an
authority and signing additional certificates for use with individual
services?

The answer should include
  A) A list of openssl commands.
  B) For each command brief description of the purpose of the command
  C) A description of how to install the result as an authoritative
 certificate so that clients automatically accept certificates
 signed by the result.

The only thing I can offer is that if you help me then I will attempt
to write a very detailed and accurate description of the process so
that newbs like me don't have such a difficult time adopting this
system in the future.

Thanks,

- Jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


HPUX compile woes

2006-01-26 Thread Jeff Fulmer
I'm trying to compile openssl-0.9.8a on HPUX with the following
configuration:

#!/bin/sh
 
./config \
  --prefix=/usr/local/ssl \
  no-asm   \
  threads   \
  zlib   \
  -fPIC 

It barfs here everytime. I wouldn't think it would go to the assembler
with the no-asm: 

gcc -I.. -I../.. -I../../include -DZLIB -DOPENSSL_THREADS  -DDSO_DL
-fPIC -D_REENTRANT -march=2.0 -O3 -DB_ENDIAN -D_REENTRANT   -c -o
b_print.o b_print.c
/var/tmp/cc8MBUWc.s: Assembler messages:
/var/tmp/cc8MBUWc.s:1242: Error: Unknown opcode: `fneg'
make[2]: *** [b_print.o] Error 1
make[2]: Leaving directory
`/home/jdfulmer/src/openssl-0.9.8a/crypto/bio'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/jdfulmer/src/openssl-0.9.8a/crypto'
make: *** [build_crypto] Error 1

Any thoughts?

Cheers,
Jeff

-- 
#include stdio.h
int main(){int a[]={74,117,115,116,32,97,110,111,116,104,101,114,32, \
67,32,104,97,99,107,101,114,10,0}; int *b=a;while(*b0)putchar(*b++);}
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: HPUX compile woes

2006-01-26 Thread Jeff Fulmer
On Thu, Jan 26, 2006 at 12:08:36PM -0800, Rick Jones wrote:
 Jeff Fulmer wrote:
 I'm trying to compile openssl-0.9.8a on HPUX with the following
 configuration:
 
 #!/bin/sh
  
 ./config \
   --prefix=/usr/local/ssl \
   no-asm   \
   threads   \
   zlib   \
   -fPIC 
 
 It barfs here everytime. I wouldn't think it would go to the assembler
 with the no-asm: 
 
 gcc -I.. -I../.. -I../../include -DZLIB -DOPENSSL_THREADS  -DDSO_DL
 -fPIC -D_REENTRANT -march=2.0 -O3 -DB_ENDIAN -D_REENTRANT   -c -o
 b_print.o b_print.c
 /var/tmp/cc8MBUWc.s: Assembler messages:
 /var/tmp/cc8MBUWc.s:1242: Error: Unknown opcode: `fneg'
 make[2]: *** [b_print.o] Error 1
 make[2]: Leaving directory
 `/home/jdfulmer/src/openssl-0.9.8a/crypto/bio'
 make[1]: *** [subdirs] Error 1
 make[1]: Leaving directory `/home/jdfulmer/src/openssl-0.9.8a/crypto'
 make: *** [build_crypto] Error 1
 
 Any thoughts?
 
 First thought, _which_ HPUX revision and platform (PA or IPF)? (I'm 
 guessing PA since it says -march=2.0 but who knows... :)

Correct: PA

 
 Second, _which_ gcc version?

Reading specs from
/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 
 Third, is the /var/tmp/cc8MBUWc.s file an assembly file from openssl, or is 
 it perhaps an assembly file from the compiler and there is a mismatch 
 bewteen the front-end and the back-end?  Is gcc using the gnu (?) assembler 
 or the HP assembler?  I've no idea which it should use, but do recall there 
 being issues in that area in the past in other places.

I believe I'm using the gnu assembler; not sure if it agrees...
 
 Fourth - any particular reason you are tossing-out any of the previous good 
 work done for fast assembly versions of some things?
 
Largely because the the last time I compiled openssl on HPUX after much
blood, sweat and tears my success was found by turing off the assembler.
If I could utilize all that good work, I'd love to...


 BTW, that reminds me of something I've been meaning to ask - does the 
 --no-asm simply preclude using stuff in a -s file, or will it also disable 
 the use of assembly that is inline in a .c file?  I seem to recall that 
 some of the hand-crafted assembly routines for some platforms are in .c 
 files rather than .s files.
 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   [EMAIL PROTECTED]
 

Jeff

-- 
#include stdio.h
int main(){int a[]={74,117,115,116,32,97,110,111,116,104,101,114,32, \
67,32,104,97,99,107,101,114,10,0}; int *b=a;while(*b0)putchar(*b++);}
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: HPUX compile woes

2006-01-26 Thread Jeff Fulmer
On Thu, Jan 26, 2006 at 12:58:21PM -0800, Rick Jones wrote:
 Second, _which_ gcc version?
 
 
 Reading specs from
 /opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/2.95.2/specs
 gcc version 2.95.2 19991024 (release)
 
 Are you still running 11.0?
 

Yeah, B.11.00 

-- 
#include stdio.h
int main(){int a[]={74,117,115,116,32,97,110,111,116,104,101,114,32, \
67,32,104,97,99,107,101,114,10,0}; int *b=a;while(*b0)putchar(*b++);}
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Seeking Merge Module

2005-12-13 Thread Jeff Bowman



Hello

Does anyone know 
whether a Windows Installer Merge Module is available for 
OpenSSL?

Thanks,
Jeff 
Bowman



Seeking Merge Module

2005-12-12 Thread Jeff Bowman



Hello

Does anyone know 
whether a Windows Installer Merge Module is available for 
OpenSSL?

Thanks,
Jeff 
Bowman



make error

2005-11-30 Thread Jeff Besecker
On SCO Open Server 5 I am receiving an error during
the make process. Version of openssl is 0.9.8a.  Here
is the make report output.  Any ideas?


wytest# make report
Checking compiler...
Creating cctest.a
Running make...
making all in crypto...
cc -I. -I.. -I../include -DDSO_DLFCN
-DHAVE_DLFCN_H -belf -DOPENSSL_BN_ASM_PART_WORDS
-DOPENSSL_IA32_SSE2 -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
-DAES_ASM -c -o x86cpuid-elf.o x86cpuid-elf.s
x86cpuid-elf.s:132:invalid register: %xmm0
x86cpuid-elf.s:132:invalid register: %xmm0
x86cpuid-elf.s:132:unknown instruction: pxor
x86cpuid-elf.s:133:invalid register: %xmm1
x86cpuid-elf.s:133:invalid register: %xmm1
x86cpuid-elf.s:133:unknown instruction: pxor
x86cpuid-elf.s:134:invalid register: %xmm2
x86cpuid-elf.s:134:invalid register: %xmm2
x86cpuid-elf.s:134:unknown instruction: pxor
x86cpuid-elf.s:135:invalid register: %xmm3
x86cpuid-elf.s:135:invalid register: %xmm3
x86cpuid-elf.s:135:unknown instruction: pxor
x86cpuid-elf.s:136:invalid register: %xmm4
x86cpuid-elf.s:136:invalid register: %xmm4
x86cpuid-elf.s:136:unknown instruction: pxor
x86cpuid-elf.s:137:invalid register: %xmm5
x86cpuid-elf.s:137:invalid register: %xmm5
x86cpuid-elf.s:137:unknown instruction: pxor
x86cpuid-elf.s:138:invalid register: %xmm6
x86cpuid-elf.s:138:invalid register: %xmm6
x86cpuid-elf.s:138:unknown instruction: pxor
...too many errors
*** Error code 1 (bu21)
*** Error code 1 (bu21)
Running make test...
Doing certs
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
argena.pem = .0
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate argeng.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate eng1.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate eng2.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate eng3.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate eng4.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate eng5.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate RegTP-5R.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate RegTP-6R.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate thawteCb.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate thawteCp.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate vsign1.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate vsign3.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate vsignss.pem
/a/tmp/openssl/openssl-0.9.8a/util/opensslwrap.sh:
/a/tmp/openssl/openssl-0.9.8a/util/../apps/openssl:
not found
WARNING: Skipping duplicate certificate wellsfgo.pem
touch rehash.time
testing...
cc -I.. -I../include  -DDSO_DLFCN
-DHAVE_DLFCN_H -belf -DOPENSSL_BN_ASM_PART_WORDS
-DOPENSSL_IA32_SSE2 -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
-DAES_ASM -c bntest.c
../include/openssl/sha.h, line 173: error: invalid
type combination
../include/openssl/sha.h, line 174: error: invalid
type combination
../include/openssl/sha.h, line 176: error: invalid
type combination
*** Error code 1 (bu21)
*** Error code 1 (bu21)

OpenSSL self-test report:

OpenSSL version:  0.9.8a
Last change:  Remove the functionality of
SSL_OP_MSIE_SSLV2_RSA_PADDI...
Options:  --prefix=/usr/local
--openssldir=/usr/local/openssl no-gmp no-krb5 no-mdc2
no-rc5 no-shared no-threads no-zlib no-zlib-dynamic
OS (uname):   SCO_SV wytest 3.2 2 i386
OS (config):  whatever-whatever-sco5
Target (default): sco5-cc
Target:   sco5-cc
Compiler: SCO UNIX Development System  Release
5.0.0a 16Mar95
Usage: cc [ options ] files ...

Failure!
[...]

Test report in file testlog
wytest#




__ 
Yahoo! Music Unlimited 

Re: X509_verrify_cert worked in 0.9.7c but not in 0.9.8

2005-11-16 Thread Jeff Davey
Well. I figured this out.

The problem is, we were using the system header files (OpenSSL-0.9.7e)
to build the binary, but we were linking in the 0.9.8a static library.

I added the 0.9.8a header files to the include path, and the problem
went away.


On Wed, 2005-09-28 at 17:58 -0600, Jeff Davey wrote:
 On Thu, 2005-09-29 at 01:50 +0200, Dr. Stephen Henson wrote:
  Sorry I must have missed that. Can you send a report to RT? Do you get the
  same problems using the verify utility? That should pretty much make the 
  same
  calls. If you do please include the certificates and the command line you
  used.
 
 
 I'll spend some time tomorrow trying to replicate this problem using the
 verify utility (end of the day here at the office).
 
 I'm not sure what you mean by Can you send a report to RT?
 
 
 
 
 __
 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: X509_verrify_cert worked in 0.9.7c but not in 0.9.8

2005-09-28 Thread Jeff Davey
On Wed, 2005-09-28 at 23:22 +0200, Dr. Stephen Henson wrote:
 What circumstances give that error: what command or application? Can you
 include the certificate chain that does that? 
 


I have also noticed this problem with 0.9.8, and reported it here on
this list August 8th (with no response).

I also posted example source code.

It seems that this problem is only cropping up for me on Intel 32bit
Linux, but not x86_64 Linux, nor Intel 32bit Netware.




__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: X509_verrify_cert worked in 0.9.7c but not in 0.9.8

2005-09-28 Thread Jeff Davey
On Thu, 2005-09-29 at 01:50 +0200, Dr. Stephen Henson wrote:
 Sorry I must have missed that. Can you send a report to RT? Do you get the
 same problems using the verify utility? That should pretty much make the same
 calls. If you do please include the certificates and the command line you
 used.


I'll spend some time tomorrow trying to replicate this problem using the
verify utility (end of the day here at the office).

I'm not sure what you mean by Can you send a report to RT?




__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Problems with X509_verify_cert and 0.9.8

2005-08-04 Thread Jeff Davey
I'm having a very peculiar problem.

I'm doing the following to verify that this cert is signed by our root
certificate, and that it's a valid cert:


X509_STORE *store = X509_STORE_new();

if (store)
{
X509_STORE_set_verify_cb_func(store, _glicVerificationCallback);

// load the CACert
X509 *caCert = X509_new();
if (caCert)
{
unsigned char *caDERPtr = subCACert[0]; // subCACert is our public 
root certificate
if ( d2i_X509(caCert, caDERPtr, CACERTLENGTH) )
{
if ( X509_STORE_add_cert(store, caCert) )
{
X509_STORE_CTX *verifyCTX = X509_STORE_CTX_new();
if (verifyCTX  X509_STORE_CTX_init(verifyCTX, store, 
licenseCert, NULL))  // licenseCert is passed in
{
if (X509_verify_cert(verifyCTX))
printf(yay:)\n);
else
printf(nay:(\n);
X509_STORE_CTX_free(verifyCTX);
}
}
}
X509_free(caCert);
}

X509_STORE_free(store);
}


Now what's strange, is this works (I get a yay:)) on two of the three platforms 
we support, using the same cert, of course.

Specifically, it works on x86-64 and Netware.
Specficially, it DOES NOT work on x86. (I get a nay:()

The error it returns is: X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT

This also works fine on ALL THREE platforms (x86-64, Netware, x86) using 0.9.7g.

Any ideas?


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


  1   2   >