[ I am a US citizen in the US, so I'm resending this with a Cc to
   [EMAIL PROTECTED]  Sorry for not reading the README.  I also
   sent this to openssl-users after reading on the web pages that
   openssl-dev submissions were restricted to subscribers, thinking
   that my openssl-dev note would be dropped by majordomo.  Sorry
   for making such a mess over a trivial patch! ]


This minor patch fixes a warning we get from our code when we pass
a constant string to EVP_BytesToKey as the salt string.  We have
our warnings treated in errors in our code base, so it'd be nice
to get this minor correction folded back into the master OpenSSL
sources.

EVP_BytesToKey only passes SALT off to EVP_DigestUpdate(), which
declares that parameter as (const void *), so changing the decl
from (unsigned char *) to (const unsigned char *) in EVP_BytesToKey
is harmless (constness is preserved, and we should let the compiler
know about it).

This patch was generated against openssl-0.9.6a.

Thanks!

Jason
Yahoo! Inc.

2001-04-12  Jason Molenda  (jason-openssl at molenda com)

        * crypto/evp/evp_key.c (EVP_BytesToKey): Declare SALT as const.
        * crypto/evp/evp.h (EVP_BytesToKey): Ditto.


--- crypto/evp/evp_key.c-dist   Thu Apr 12 17:18:58 2001
+++ crypto/evp/evp_key.c        Thu Apr 12 17:26:10 2001
@@ -95,9 +95,9 @@ 
 #endif
        }
 
-int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, unsigned char *salt,
-            unsigned char *data, int datal, int count, unsigned char *key,
-            unsigned char *iv)
+int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, 
+             const unsigned char *salt, unsigned char *data, int datal, 
+             int count, unsigned char *key, unsigned char *iv)
        {
        EVP_MD_CTX c;
        unsigned char md_buf[EVP_MAX_MD_SIZE];
--- crypto/evp/evp.h-dist       Thu Apr 12 17:22:49 2001
+++ crypto/evp/evp.h    Thu Apr 12 17:25:52 2001
@@ -554,9 +554,9 @@ 
 void   EVP_set_pw_prompt(char *prompt);
 char * EVP_get_pw_prompt(void);
 
-int    EVP_BytesToKey(const EVP_CIPHER *type,EVP_MD *md,unsigned char *salt,
-               unsigned char *data, int datal, int count,
-               unsigned char *key,unsigned char *iv);
+int     EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md,
+               const unsigned char *salt, unsigned char *data, int datal,
+                       int count, unsigned char *key, unsigned char *iv);
 
 int    EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
                unsigned char *key, unsigned char *iv);
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to