Bodo Moeller wrote:

> Do you use one large buffer and read only once?  Even if you believe
> that all data should fit into one buffer, you have to call the reading
> function again and again until it notifies you of EOF.
> ______________________________________________________________________
> OpenSSL Project                               http://www.openssl.org
> Development Mailing List                       [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]

Oooopps, silly me. I removed the bio_read stuff and cleaned up some more.
The diff now only concerns:

crypto/evp/e_cbc_r2.c
crypto/evp/m_sha1.c
crypto/objects/objects.h
crypto/pkcs7/pk7_doit.c

I don't think the changes will affect any of the ssl-code (and they pass all
the tests).

Sak
Only in openssl-0.9.2b/crypto/bf: blowfish.doc
Only in openssl-0.9.2b/crypto/bn/asm: bn86unix.cpp
Only in openssl-0.9.2b/crypto/bn/asm: co86unix.cpp
Only in openssl-0.9.2b/crypto/cast/asm: cx86unix.cpp
Only in openssl-0.9.2b/crypto: date.h
Only in openssl-0.9.2b/crypto/des/asm: dx86unix.cpp
Only in openssl-0.9.2b/crypto/des/asm: yx86unix.cpp
diff -ur -x obj_dat.h openssl-0.9.2b-orig/crypto/evp/e_cbc_r2.c 
openssl-0.9.2b/crypto/evp/e_cbc_r2.c
--- openssl-0.9.2b-orig/crypto/evp/e_cbc_r2.c   Mon Dec 21 11:59:23 1998
+++ openssl-0.9.2b/crypto/evp/e_cbc_r2.c        Tue Mar 30 17:26:39 1999
@@ -102,7 +102,7 @@
 
 static EVP_CIPHER r2_64_cbc_cipher=
        {
-       NID_rc2_40_cbc,
+       NID_rc2_64_cbc,   /* NID_rc2_40_cbc, sak */
        8,8 /* 64 bit */,8,
        rc2_cbc_init_key,
        rc2_cbc_cipher,
@@ -173,9 +173,9 @@
        int i;
 
        i=EVP_CIPHER_key_length(e);
-       if      (i == 128) return(RC2_128_MAGIC);
-       else if (i == 64)  return(RC2_64_MAGIC);
-       else if (i == 40)  return(RC2_40_MAGIC);
+       if      (i == 16) return(RC2_128_MAGIC); /* i == 128 sak */
+       else if (i == 8)  return(RC2_64_MAGIC); /* i == 64 sak */
+       else if (i == 5)  return(RC2_40_MAGIC); /* i == 40 sak */
        else return(0);
        }
 
diff -ur -x obj_dat.h openssl-0.9.2b-orig/crypto/evp/m_sha1.c 
openssl-0.9.2b/crypto/evp/m_sha1.c
--- openssl-0.9.2b-orig/crypto/evp/m_sha1.c     Mon Dec 21 11:55:18 1998
+++ openssl-0.9.2b/crypto/evp/m_sha1.c  Fri Apr 23 17:40:55 1999
@@ -65,7 +65,7 @@
 static EVP_MD sha1_md=
        {
        NID_sha1,
-       NID_sha1WithRSAEncryption,
+       NID_rsaEncryption, /* Had to change this from sha1WithRSAEncryption, sak */
        SHA_DIGEST_LENGTH,
        SHA1_Init,
        SHA1_Update,
Only in openssl-0.9.2b/crypto/md5/asm: mx86unix.cpp
diff -ur -x obj_dat.h openssl-0.9.2b-orig/crypto/objects/objects.h 
openssl-0.9.2b/crypto/objects/objects.h
--- openssl-0.9.2b-orig/crypto/objects/objects.h        Fri Feb 19 02:29:26 1999
+++ openssl-0.9.2b/crypto/objects/objects.h     Mon Apr 19 10:36:08 1999
@@ -1,4 +1,5 @@
 /* crypto/objects/objects.h */
+
 /* Copyright (C) 1995-1998 Eric Young ([EMAIL PROTECTED])
  * All rights reserved.
  *
@@ -527,6 +528,8 @@
 #define SN_rc2_40_cbc                  "RC2-40-CBC"
 #define LN_rc2_40_cbc                  "rc2-40-cbc"
 #define NID_rc2_40_cbc                 98
+/* OID added, sak */
+#define OBJ_rc2_40_cbc                 OBJ_rsadsi,3L,2L
 
 #define SN_givenName                   "G"
 #define LN_givenName                   "givenName"
@@ -753,6 +756,13 @@
 #define LN_invalidity_date             "Invalidity Date"
 #define NID_invalidity_date            142
 #define OBJ_invalidity_date            OBJ_ld_ce,24L
+
+/* NID_rc2_64_cbc added by sak */
+#define SN_rc2_64_cbc                  "RC2-64-CBC"
+#define LN_rc2_64_cbc                  "rc2-64-cbc"
+#define NID_rc2_64_cbc                 143
+/* OID added, sak */
+#define OBJ_rc2_64_cbc                 OBJ_rsadsi,3L,2L
 
 #include "bio.h"
 #include "asn1.h"
diff -ur -x obj_dat.h openssl-0.9.2b-orig/crypto/pkcs7/pk7_doit.c 
openssl-0.9.2b/crypto/pkcs7/pk7_doit.c
--- openssl-0.9.2b-orig/crypto/pkcs7/pk7_doit.c Sun Mar 14 14:31:40 1999
+++ openssl-0.9.2b/crypto/pkcs7/pk7_doit.c      Fri May  7 15:45:41 1999
@@ -160,16 +160,7 @@
 
                if (ivlen > 0)
                        {
-                       ASN1_OCTET_STRING *os;
-
                        RAND_bytes(iv,ivlen);
-                       os=ASN1_OCTET_STRING_new();
-                       ASN1_OCTET_STRING_set(os,iv,ivlen);
-/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX this needs to change */
-                       if (xalg->parameter == NULL)
-                               xalg->parameter=ASN1_TYPE_new();
-                       ASN1_TYPE_set(xalg->parameter,V_ASN1_OCTET_STRING,
-                               (char *)os);
                        }
                RAND_bytes(key,keylen);
 
@@ -209,7 +200,15 @@
                        }
                Free(tmp);
 
+               /* Need to set the algorithm parameter using context. sak */
                BIO_set_cipher(btmp,evp_cipher,key,iv,1);
+               if (ivlen > 0) {
+                   EVP_CIPHER_CTX *evp_ctx;
+                   BIO_get_cipher_ctx(btmp, &evp_ctx);
+                   if (xalg->parameter == NULL)
+                       xalg->parameter=ASN1_TYPE_new();
+                   evp_cipher->set_asn1_parameters(evp_ctx,xalg->parameter);
+               }
 
                if (out == NULL)
                        out=btmp;
@@ -217,7 +216,6 @@
                        BIO_push(out,btmp);
                btmp=NULL;
                }
-
        if (bio == NULL) /* ??????????? */
                {
                if (p7->detached)
@@ -417,7 +415,9 @@
                evp_ctx=NULL;
                BIO_get_cipher_ctx(etmp,&evp_ctx);
                EVP_CipherInit(evp_ctx,evp_cipher,NULL,NULL,0);
-               if (EVP_CIPHER_asn1_to_param(evp_ctx,enc_alg->parameter) < 0)
+               /* Added support for non RC2 ciphers, sak */
+               if (evp_cipher->get_asn1_parameters != NULL && 
+                   evp_cipher->get_asn1_parameters(evp_ctx,enc_alg->parameter) < 0)
                        return(NULL);
 
                if (jj != EVP_CIPHER_CTX_key_length(evp_ctx))
@@ -569,6 +569,11 @@
                                ASN1_OCTET_STRING *digest;
                                ASN1_UTCTIME *sign_time;
                                EVP_MD *md_tmp;
+
+                               /* Add content type, sak */
+                               PKCS7_add_signed_attribute(si,
+                                       NID_pkcs9_contentType,
+                                       V_ASN1_OBJECT,(char 
+*)OBJ_nid2obj(NID_pkcs7_data));
 
                                /* Add signing time */
                                sign_time=X509_gmtime_adj(NULL,0);
Only in openssl-0.9.2b/crypto/rc4/asm: rx86unix.cpp
Only in openssl-0.9.2b/crypto/ripemd/asm: rm86unix.cpp
begin:          vcard
fn:             Sebastian Akerman
n:              Akerman;Sebastian
org:            <img src="http://www.parallelconsulting.com/content_img/pslogga.gif" alt="Parallel Systems">
email;internet: [EMAIL PROTECTED]
title:          Security Expert
note:           If you care to trust us download our CA certificate from www.parallelconsulting.com
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard

Reply via email to