Re: 1.0.0a s_server with GOST certificate can't compute sha1 digest???

2010-11-13 Thread Dr. Stephen Henson
On Sat, Nov 13, 2010, Andrey Kulikov wrote:

 Hello,
 
 On 13 November 2010 03:33, Dr. Stephen Henson st...@openssl.org wrote:
 
  I've just tried 1.0.1 and it does have a problem with GOST and TLS v1.1 
  which
  is the default for OpenSSL 1.0.1. If you include -no_tls1_1 in the command
  line it should work or if you try a recent 1.0.0 snapshot (OpenSSL 1.0.0
  doesn't support TLS v1.1).
 
  I'll look into the TLS v1.1 issue.
 
  Steve.
 
 
 Sorry to confuse you - I've mixed up versions and snapshot filenames.
 I just re-check these snapshots of 1.0.0
 ftp://ftp.openssl.org/snapshot/openssl-1.0.0-stable-SNAP-20101112.tar.gz
 and 1.0.1
 ftp://ftp.openssl.org/snapshot/openssl-1.0.1-stable-SNAP-20101112.tar.gz
 
 I disable TSL in there:
 ./config no-tls
 
 I add -ssl3 parameter to s_server and s_client commands.
 
 ./apps/openssl s_server -ssl3  -www -engine gost -accept 4333  -state
 -cert botcert.pem -key botkey.p8
 ./apps/openssl s_client -ssl3 -engine gost  -connect localhost:4333
 
 And both of these versions are not working in the same way.
 
 s_server
 =
 SSL3 alert write:fatal:bad record mac
 SSL_accept:error in SSLv3 read certificate verify A
 3076736652:error:1411D144:SSL routines:ssl3_handshake_mac:digest
 requred for handshake isn't computed:s3_enc.c:668:
 =
 
 s_client
 =
 verify return:1
 3076413068:error:1411D144:SSL routines:ssl3_handshake_mac:digest
 requred for handshake isn't computed:s3_enc.c:668:
 =
 
 So, the problem not in TLS1.1
 
 BTW: 1.0.1 s_server doesn't accept -no_tls1_1 option, while have it in
 help option list.
 s_client does accept this option.
 
 

FYI I've just fixed up s_server to accept the TLS1.1 options.

I get that error with SSLv3 so don't disable it at config time or on the
command line. 

Don't use the -engine gost option to s_server either. If your openssl.cnf is
set up correctly you shouldn't need it.

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
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


Re: 1.0.0a s_server with GOST certificate can't compute sha1 digest???

2010-11-13 Thread Dr. Stephen Henson
On Sat, Nov 13, 2010, Andrey Kulikov wrote:

 Hello,
 
 On 13 November 2010 03:33, Dr. Stephen Henson st...@openssl.org wrote:
 
  I've just tried 1.0.1 and it does have a problem with GOST and TLS v1.1 
  which
  is the default for OpenSSL 1.0.1. If you include -no_tls1_1 in the command
  line it should work or if you try a recent 1.0.0 snapshot (OpenSSL 1.0.0
  doesn't support TLS v1.1).
 
  I'll look into the TLS v1.1 issue.
 
  Steve.
 
 
 Sorry to confuse you - I've mixed up versions and snapshot filenames.
 I just re-check these snapshots of 1.0.0
 ftp://ftp.openssl.org/snapshot/openssl-1.0.0-stable-SNAP-20101112.tar.gz
 and 1.0.1
 ftp://ftp.openssl.org/snapshot/openssl-1.0.1-stable-SNAP-20101112.tar.gz
 
 I disable TSL in there:
 ./config no-tls
 
 I add -ssl3 parameter to s_server and s_client commands.
 
 ./apps/openssl s_server -ssl3  -www -engine gost -accept 4333  -state
 -cert botcert.pem -key botkey.p8
 ./apps/openssl s_client -ssl3 -engine gost  -connect localhost:4333
 
 And both of these versions are not working in the same way.
 
 s_server
 =
 SSL3 alert write:fatal:bad record mac
 SSL_accept:error in SSLv3 read certificate verify A
 3076736652:error:1411D144:SSL routines:ssl3_handshake_mac:digest
 requred for handshake isn't computed:s3_enc.c:668:
 =
 
 s_client
 =
 verify return:1
 3076413068:error:1411D144:SSL routines:ssl3_handshake_mac:digest
 requred for handshake isn't computed:s3_enc.c:668:
 =
 

Sorry I missed the -ssl3 command option in your other messages. The GOST
ciphersuites don't work with SSLv3 but OpenSSL shouldn't be giving that error
message: it should just disable GOST ciphersuites if SSLv3 is negotiated.

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
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


Re: 1.0.0a s_server with GOST certificate can't compute sha1 digest???

2010-11-12 Thread Dr. Stephen Henson
On Fri, Nov 12, 2010, Andrey Kulikov wrote:

 Hello,
 
 I'm trying to make s_server and s_client work with GOST encryption
 using ccgost engine and certificates with GOST algos.
 But it unable to work, complaining to bad mac computing.
 (If I use RSA-based certificates, everything works just fine.)
 

Please try a recent 1.0.0 snapshot and see if you still have this problem.

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
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


Re: 1.0.0a s_server with GOST certificate can't compute sha1 digest???

2010-11-12 Thread Andrey Kulikov
On 12 November 2010 15:20, Dr. Stephen Henson st...@openssl.org wrote:
 On Fri, Nov 12, 2010, Andrey Kulikov wrote:

 Hello,

 I'm trying to make s_server and s_client work with GOST encryption
 using ccgost engine and certificates with GOST algos.
 But it unable to work, complaining to bad mac computing.
 (If I use RSA-based certificates, everything works just fine.)


 Please try a recent 1.0.0 snapshot and see if you still have this problem.

 Steve.

I check with
ftp://ftp.openssl.org/snapshot/openssl-1.0.1-stable-SNAP-20101112.tar.gz

Visible behaviour is the same.
Commands output is the same.

Test procedure the same as described in original message:
Modify openssl.cnf

export OPENSSL_CONF=path to /openssl.cnf

./apps/openssl genpkey -engine gost -algorithm gost2001 -pkeyopt
paramset:A -out botkey.p8

./apps/openssl req -config ./apps/openssl.cnf -x509 -days 1095 -subj
'/C=RU/CN=csp_srv/o=lapu...@mail.ru' -engine gost -new -key botkey.p8
-out botcert.pem


./apps/openssl s_server -www -engine gost -accept 4333  -state -cert
botcert.pem -key botkey.p8

./apps/openssl s_client -engine gost -ssl3  -connect localhost:4333


s_client output (truncated):
==
~/comt_area/openssl-1.0.1-stable-SNAP-20101112# ./apps/openssl
s_client -engine gost -ssl3  -connect localhost:4333
engine gost set.
CONNECTED(0003)
depth=0 C = RU, CN = csp_srv, O = lapu...@mail.ru
verify error:num=18:self signed certificate
verify return:1
depth=0 C = RU, CN = csp_srv, O = lapu...@mail.ru
verify return:1
3076486796:error:1411D144:SSL routines:ssl3_handshake_mac:digest
requred for handshake isn't computed:s3_enc.c:668:
3076486796:error:1411D144:SSL routines:ssl3_handshake_mac:digest
requred for handshake isn't computed:s3_enc.c:668:
3076486796:error:140943FC:SSL routines:SSL3_READ_BYTES:sslv3 alert bad
record mac:s3_pkt.c:1212:SSL alert number 20
3076486796:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake
failure:s3_pkt.c:591:
---
Certificate chain
 0 s:/C=RU/CN=csp_srv/o=lapu...@mail.ru
   i:/C=RU/CN=csp_srv/o=lapu...@mail.ru
---
==

s_server output (truncated)
==
:~/comt_area/openssl-1.0.1-stable-SNAP-20101112#  ./apps/openssl
s_server -www -engine gost -accept 4333  -state -cert botcert.pem -key
botkey.p8
engine gost set.
Using default temp DH parameters
Using default temp ECDH parameters
ACCEPT
SSL_accept:before/accept initialization
SSL_accept:SSLv3 read client hello A
SSL_accept:SSLv3 write server hello A
SSL_accept:SSLv3 write certificate A
SSL_accept:SSLv3 write server done A
SSL_accept:SSLv3 flush data
SSL_accept:SSLv3 read client key exchange A
SSL3 alert write:fatal:bad record mac
SSL_accept:error in SSLv3 read certificate verify A
SSL_accept:error in SSLv3 read certificate verify A
3076945548:error:1411D144:SSL routines:ssl3_handshake_mac:digest
requred for handshake isn't computed:s3_enc.c:668:
3076945548:error:1411D144:SSL routines:ssl3_handshake_mac:digest
requred for handshake isn't computed:s3_enc.c:668:
3076945548:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076945548:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076945548:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076945548:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076945548:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076945548:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076945548:error:8808C074:lib(136):GOST_IMIT_FINAL:mac key not
set:gost_crypt.c:564:
3076945548:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076945548:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076945548:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076945548:error:8808C074:lib(136):GOST_IMIT_FINAL:mac key not
set:gost_crypt.c:564:
3076945548:error:1408F119:SSL routines:SSL3_GET_RECORD:decryption
failed or bad record mac:s3_pkt.c:479:

__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


Re: 1.0.0a s_server with GOST certificate can't compute sha1 digest???

2010-11-12 Thread Andrey Kulikov
Sorry, previous email is about 1.0.1 latest snapshot.

I just checked with 1.0.1
ftp://ftp.openssl.org/snapshot/openssl-1.0.0-stable-SNAP-20101112.tar.gz

Results exactly the same.
If you'll need any details - please let me know.

Andrey

On 13 November 2010 00:43, Andrey Kulikov amde...@gmail.com wrote:
 On 12 November 2010 15:20, Dr. Stephen Henson st...@openssl.org wrote:
 On Fri, Nov 12, 2010, Andrey Kulikov wrote:

 Hello,

 I'm trying to make s_server and s_client work with GOST encryption
 using ccgost engine and certificates with GOST algos.
 But it unable to work, complaining to bad mac computing.
 (If I use RSA-based certificates, everything works just fine.)


 Please try a recent 1.0.0 snapshot and see if you still have this problem.

 Steve.

 I check with
 ftp://ftp.openssl.org/snapshot/openssl-1.0.1-stable-SNAP-20101112.tar.gz

 Visible behaviour is the same.
 Commands output is the same.

 Test procedure the same as described in original message:
__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


Re: 1.0.0a s_server with GOST certificate can't compute sha1 digest???

2010-11-12 Thread Dr. Stephen Henson
On Sat, Nov 13, 2010, Andrey Kulikov wrote:

 Sorry, previous email is about 1.0.1 latest snapshot.
 
 I just checked with 1.0.1
 ftp://ftp.openssl.org/snapshot/openssl-1.0.0-stable-SNAP-20101112.tar.gz
 
 Results exactly the same.
 If you'll need any details - please let me know.
 

Did you install the GOST ENGINE from that version? The 1.0.0 version has a
known issue with macs.

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
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


Re: 1.0.0a s_server with GOST certificate can't compute sha1 digest???

2010-11-12 Thread Dr. Stephen Henson
On Sat, Nov 13, 2010, Andrey Kulikov wrote:

 Sorry, previous email is about 1.0.1 latest snapshot.
 
 I just checked with 1.0.1
 ftp://ftp.openssl.org/snapshot/openssl-1.0.0-stable-SNAP-20101112.tar.gz
 
 Results exactly the same.
 If you'll need any details - please let me know.
 

I've just tried 1.0.1 and it does have a problem with GOST and TLS v1.1 which
is the default for OpenSSL 1.0.1. If you include -no_tls1_1 in the command
line it should work or if you try a recent 1.0.0 snapshot (OpenSSL 1.0.0
doesn't support TLS v1.1).

I'll look into the TLS v1.1 issue.

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
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


Re: 1.0.0a s_server with GOST certificate can't compute sha1 digest???

2010-11-12 Thread Andrey Kulikov
Hello,

On 13 November 2010 03:33, Dr. Stephen Henson st...@openssl.org wrote:

 I've just tried 1.0.1 and it does have a problem with GOST and TLS v1.1 which
 is the default for OpenSSL 1.0.1. If you include -no_tls1_1 in the command
 line it should work or if you try a recent 1.0.0 snapshot (OpenSSL 1.0.0
 doesn't support TLS v1.1).

 I'll look into the TLS v1.1 issue.

 Steve.


Sorry to confuse you - I've mixed up versions and snapshot filenames.
I just re-check these snapshots of 1.0.0
ftp://ftp.openssl.org/snapshot/openssl-1.0.0-stable-SNAP-20101112.tar.gz
and 1.0.1
ftp://ftp.openssl.org/snapshot/openssl-1.0.1-stable-SNAP-20101112.tar.gz

I disable TSL in there:
./config no-tls

I add -ssl3 parameter to s_server and s_client commands.

./apps/openssl s_server -ssl3  -www -engine gost -accept 4333  -state
-cert botcert.pem -key botkey.p8
./apps/openssl s_client -ssl3 -engine gost  -connect localhost:4333

And both of these versions are not working in the same way.

s_server
=
SSL3 alert write:fatal:bad record mac
SSL_accept:error in SSLv3 read certificate verify A
3076736652:error:1411D144:SSL routines:ssl3_handshake_mac:digest
requred for handshake isn't computed:s3_enc.c:668:
=

s_client
=
verify return:1
3076413068:error:1411D144:SSL routines:ssl3_handshake_mac:digest
requred for handshake isn't computed:s3_enc.c:668:
=

So, the problem not in TLS1.1

BTW: 1.0.1 s_server doesn't accept -no_tls1_1 option, while have it in
help option list.
s_client does accept this option.


WBR,
Andrey
__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


1.0.0a s_server with GOST certificate can't compute sha1 digest???

2010-11-11 Thread Andrey Kulikov
Hello,

I'm trying to make s_server and s_client work with GOST encryption
using ccgost engine and certificates with GOST algos.
But it unable to work, complaining to bad mac computing.
(If I use RSA-based certificates, everything works just fine.)

Openssl 1.0.0a, Linux i386

I have ccgost statically linked in openssl.
I've add following lines to openssl config file:
=
openssl_conf = openssl_def

[openssl_def]
engines = engine_section

[engine_section]
gost = gost_section

[gost_section]
engine_id = gost
default_algorithms = ALL
CRYPT_PARAMS = id-Gost28147-89-CryptoPro-A-ParamSet
=

Then execute
export OPENSSL_CONF=path to /openssl.cnf

Generate key and self-signed certificate using GOST algos.

#Generate private key
./apps/openssl genpkey -engine gost -algorithm gost2001 -pkeyopt
paramset:A -out botkey.p8
# Create self-sign certificate
./apps/openssl req -config ./apps/openssl.cnf -x509 -days 1095 -subj
'/C=RU/CN=csp_srv/o=lapu...@mail.ru' -engine gost -new -key botkey.p8
-out botcert.pem

# Dump ASN format files to check that it what we expect
openssl asn1parse -in botkey.p8
openssl asn1parse -in botcert.pem


When start s_server

 ./apps/openssl s_server -www -engine gost -accept 4333  -state -cert
botcert.pem -key botkey.p8

./apps/openssl s_client -engine gost -ssl3  -connect localhost:4333

Client output (truncated):

.
3076867724:error:1411D144:SSL routines:ssl3_handshake_mac:digest
requred for handshake isn't computed:s3_enc.c:669:
3076867724:error:1411D144:SSL routines:ssl3_handshake_mac:digest
requred for handshake isn't computed:s3_enc.c:669:
3076867724:error:140943FC:SSL routines:SSL3_READ_BYTES:sslv3 alert bad
record mac:s3_pkt.c:1193:SSL alert number 20
3076867724:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake
failure:s3_pkt.c:590:
---
..
---
New, TLSv1/SSLv3, Cipher is GOST2001-GOST89-GOST89
Server public key is 256 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol  : SSLv3
Cipher: GOST2001-GOST89-GOST89
Session-ID: 214A3B31604763646B6E6A1DC0B793BC5979C454C25AE2ED2EE3947AA08078B0
Session-ID-ctx:
Master-Key:
93B1DB1A2B5A40CFB2E3328280FB200B044CF446E73353B735328253D690F88A01AEB9E004BC06085E4C81770269EBD7
Key-Arg   : None
PSK identity: None
PSK identity hint: None
Start Time: 1289516998
Timeout   : 7200 (sec)
Verify return code: 18 (self signed certificate)


Server output (truncated):

...
SSL_accept:SSLv3 write server done A
SSL_accept:SSLv3 flush data
SSL_accept:SSLv3 read client key exchange A
SSL3 alert write:fatal:bad record mac
SSL_accept:error in SSLv3 read certificate verify A
SSL_accept:error in SSLv3 read certificate verify A
3076998796:error:1411D144:SSL routines:ssl3_handshake_mac:digest
requred for handshake isn't computed:s3_enc.c:669:
3076998796:error:1411D144:SSL routines:ssl3_handshake_mac:digest
requred for handshake isn't computed:s3_enc.c:669:
3076998796:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076998796:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076998796:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076998796:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076998796:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076998796:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076998796:error:8808C074:lib(136):GOST_IMIT_FINAL:mac key not
set:gost_crypt.c:564:
3076998796:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076998796:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076998796:error:88073074:lib(136):GOST_IMIT_UPDATE:mac key not
set:gost_crypt.c:527:
3076998796:error:8808C074:lib(136):GOST_IMIT_FINAL:mac key not
set:gost_crypt.c:564:
3076998796:error:1408F119:SSL routines:SSL3_GET_RECORD:decryption
failed or bad record mac:s3_pkt.c:478:
ACCEPT



The problem is in ssl3_final_finish_mac function (ssl/s3_enc.c:636),
called somewhere from ssl3_do_change_cipher_spec().
It try to compute  NID_md5 and NID_sha1 digests, but in
SSL-s3-handshake_dgst[] there is only one digest -
NID_id_GostR3411_94. So we got that errors.


Could please someone advice, what the root cause of this situation,
and how to deal with it?
How to get s_server and s_client working with GOST certificates?

Best wishes,
Andrey
__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org