Re: errors in DTLS implementation in openssl0.9.8a

2005-12-12 Thread Eduardo Pérez Ureta
Maybe you can try:
http://www.aet.tu-cottbus.de/rt2/Ticket/Display.html?id=1245
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=335703
This patch may fix the segmentation fault that I also confirm on
openssl-0.9.8a running on linux-2.6.14/686
Some developer should review that patch.
(I'll try it later if nobody has)

On 2005-12-10 16:38:16 +, robert dugal wrote:
 Openssl 0.9.8a is incorrectly encoding the DTLS version as 0x01,0x00 
 instead of 0xfe,0xff
 $ ./openssl s_client -dtls1 -debug
 CONNECTED(0003)
 write to 0x5d3640 [0x5dd3f8] (119 bytes = 119 (0x77))
  - 16 01 00 00 00 00 00 00-00 00 00 00 6a 01 00 00   j...
 
 
 
 Openssl 0.9.8a is incorrectly encoding the ChangeCipherSpec message as 3 
 bytes instead of 1 byte, including a 2 byte message sequence number.
 $ ./openssl s_client -dtls1 -debug
 snipped
 write to 0x5d3640 [0x5e2d80] (16 bytes = 16 (0x10))
  - 14 01 00 00 00 00 00 00-00 00 03 00 03 01 00 03   
 The first 13 bytes are the record header followed by the CCS which is 3 
 bytes: 01 00 03
 
 There is no MSN in the CCS. I had a lengthy discussion with Eric on this 
 topic and he was very clear that the CCS has no MSN and he did not want to 
 add it to the CCS.
 
 
 I also discovered it is very easy to crash openssl or make the handshake 
 fail using the -mtu argument (testing on windows xp).
 
 ./openssl s_server -dtls1 -debug -mtu 100
 ./openssl s_client -dtls1 -debug -mtu 100
 - server Segmentation fault (core dumped)
 
 ./openssl s_server -dtls1 -debug -mtu 128
 ./openssl s_client -dtls1 -debug -mtu 128
 - server 888:error:143F8412:SSL routines:DTLS1_READ_BYTES:sslv3 alert bad 
 certificate
 - client 4052:error:1409000D:SSL routines:SSL3_GET_SERVER_CERTIFICATE:ASN1 
 lib:s3_clnt.c
 
 ./openssl s_server -dtls1 -debug -mtu 256
 ./openssl s_client -dtls1 -debug -mtu 256
 - server DTLS1_READ_BYTES:sslv3 alert bad certificate
 - client 3080:error:1409000D:SSL routines:SSL3_GET_SERVER_CERTIFICATE:ASN1 
 lib:s3_clnt.c
 
 ./openssl s_server -dtls1 -debug -mtu 512
 ./openssl s_client -dtls1 -debug -mtu 512
 - server SSL3_GET_FINISHED:digest check failed
 - client handshake failure
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


0.9.8 API/ABI compatibility with 0.9.7 ?

2005-05-24 Thread Eduardo Pérez
I was wondering if openssl-0.9.8 is going to be API/ABI compatible
with the current stable branch of openssl-0.9.7
I think keeping API/ABI compatible is a good idea and makes programmer
and users life easier.
Anyway, if you are not going to keep API/ABI compatibility in
openssl-0.9.8 with 0.9.7 I'd like to hear the reasoning behind that.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Problem at RSA decrypt: block type is not 02

2005-05-16 Thread Eduardo Pérez
What are you trying to do?
(give some details if you want any help)

Using RSA directly on the message is almost never a good idea.
(Correct me if I'm wrong but that's what you seem to be doing)
You should be using an intermediate symmetric cipher or just let openssl
or gnupg do its job and forget about the internal specifics of key
selection and protocol.

Eduardo

On 2005-05-16 07:21:25 UTC, Angel Martinez Gonzalez wrote:
 I want to cypher/decrypt messages with RSA.
 
 I use this functions to cypher and decypher:
 
 int CifradoClavePublica(RSA *claveRSA, char *texto, char **textocifrado)
 {
  int size = RSA_size(claveRSA);
  int blksize = size - 12;
  int length = strlen(texto);
  int blocks = length/blksize;
  int rest = length%blksize;
 
  int i;
  int tamano_datos_cifrados;
  int longitud_datos_cifrados = 0;
 
  if (rest == 0)
   *textocifrado = malloc(blocks*size+1);
  else
   *textocifrado = malloc((blocks+1)*size+1);
 
 
  for (i=0; iblocks; i++)
  {
   tamano_datos_cifrados = RSA_public_encrypt(blksize, texto+i*blksize,
 *textocifrado+i*size, claveRSA, RSA_PKCS1_PADDING);
   longitud_datos_cifrados = longitud_datos_cifrados + tamano_datos_cifrados;
   }
 
  if (rest != 0)
  {
   tamano_datos_cifrados = RSA_public_encrypt(rest, texto+blocks*blksize,
 *textocifrado+blocks*size, claveRSA, RSA_PKCS1_PADDING);
   longitud_datos_cifrados = longitud_datos_cifrados + tamano_datos_cifrados;
}
 
  return (longitud_datos_cifrados);
 
 }
 
 This function returns the size of the encrypted data. claveRSA is the
 public key RSA,  texto is the message to cypher, and textocifrado stores
 the ciphertext.
 
 
 To decypher, I use this function:
 
 char *DescifradoClavePrivada(RSA *claveRSA, char *texto, int
 longitud_datos_cifrados)
 {
  int size = RSA_size(claveRSA);
  int blksize = size-12;
  int length = longitud_datos_cifrados;
  int blocks = length/size;
 
  int i, error;
  int written = 0;
  char *textoclaro;
  int tamano_datos_descifrados;
 
  char *fileError = error.txt;
 
  FILE *fp;
 
   textoclaro = malloc(blocks*blksize+1);
 
  for (i=0; iblocks; i++)
  {
   printf (bucle %i\n,i);
   tamano_datos_descifrados = RSA_private_decrypt(blksize, texto+i*size,
 textoclaro+written, claveRSA, RSA_PKCS1_PADDING);
 
 
   ERR_load_crypto_strings();
   error = ERR_get_error();
   printf (Library: %s\n, ERR_lib_error_string(error));
   printf (Function: %s\n, ERR_func_error_string(error));
   printf (Reason: %s\n, ERR_reason_error_string(error));
 
   written = written + tamano_datos_descifrados;
  }
  return (textoclaro);
 
 }
 
 This function returns the plain text. claveRSA is the private key RSA,
 texto is the cyphertext to decrypt, and longitud_datos_cifrados is the
 size of the encrypted data texto.
 
 And when I run this function, I obtain this error message:
 
 Library: rsa routines
 Function: RSA_padding_check_PKCS1_type_2
 Reason: block type is not 02
 
 What meaning this error?, What it is wrong?. Thanks.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Rijndael algorithm

2005-02-10 Thread Eduardo Pérez
On 2005-02-10 08:39:24 UTC, Manuel Sánchez Cuenca wrote:
 can anybody tell me if the rijndael algorithm is supported in openssl? 
 and in this case can anybody send me some examples?

Yes, rijndael (aka aes) is supported.
Just type:
openssl ciphers -v
and you'll see all ciphers

You can also know that using Google, just type:
site:openssl.org rijndael
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: SSL (or alike) over UDP

2005-01-31 Thread Eduardo Pérez
On 2005-01-14 10:39:55 UTC, [EMAIL PROTECTED] wrote:
 There is IETF Internet Draft proposed by E. Rescorla that allows TLS over UDP
 here is the link:
 http://www.ietf.org/internet-drafts/draft-rescorla-dtls-02.txt

I'm looking forward this protocol.

The people behind this protocol told me:
We're currently working on integrating with the OpenSSL source,
so that will be the official distribution.

Here's the past release:
http://scm.sipfoundry.org/viewsvn/resiprocate/main/sip/contrib/dtls/
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Creating a ssl socket using OpenPGP keys

2005-01-31 Thread Eduardo Pérez
On 2004-09-13 18:22:15 UTC, Eduardo Pérez wrote:
 I'd like to create a simple app to chat securely.
 Requisites:
 Use OpenPGP keys on both ends (because lots of users already have
 OpenPGP keys)
 
 Procedure:
 User selects a public key to communicate
 He or the system finds the IP/TCP address
 The other end sees who is trying to contact him
 The other end accepts or refuses the connection.
 Both chat securely.
 
 
 Is there an easy way to create a SSL socket using OpenPGP keys?

I just wanted to tell that I found:
ftp://ftp.ietf.org/internet-drafts/draft-ietf-tls-openpgp-keys-06.txt
And it seems what I was looking for.

This is what N. Mavroyanopoulos told me:
 gnutls includes an implementation of this openpgp draft. 
 Most of the openpgp stuff are in:
 libextra/openpgp/

 lib/auth_dhe.c (Diffie hellman signed with openpgp/x509 keys)
 lib/auth_rsa.c (RSA with openpgp/x509 keys)
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


SSL (or alike) over UDP

2005-01-14 Thread Eduardo Pérez
Do you know if it's possible to use SSL (or some other protocol) over
UDP running totally in user space.

I'd like to prevent TCP disconnects (SSL over TCP has this problem)

I'd also like to use reliable delivery and a stream unreliable delivery
protocol over the same connection-oriented base secure protocol.

It would be like using IPSEC totally in user space but without anything
to do with IP.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]