On Sat, 1 Sep 2001 07:59:31 +0200 (MET DST), [EMAIL PROTECTED] wrote:

>ulf         01-Sep-2001 07:59:30
>
>  Modified:    crypto/evp evp_test.c
>  Log:
>  undo, didn't work

That's because you (probably accidentally) changed the code, putting an extra 
while inside another when that's not what I wrote. Here's a complete patch 
that DOES work. I've used sstrsep (as in signed vs unsigned) so as not to 
conflict on systems that DO have strsep.

Index: evp_test.c
===================================================================
RCS file: /usr/local/cvs/openssl.org/openssl/crypto/evp/evp_test.c,v
retrieving revision 1.6
diff -u -r1.6 evp_test.c
--- evp_test.c  2001/09/01 05:59:27     1.6
+++ evp_test.c  2001/09/03 03:25:35
@@ -85,8 +85,39 @@
     return s-d;
     }
 
+static char *sstrsep(char **string, const char *delim)
+    {
+    char isdelim[256];
+    char *token = *string;
+
+    if (**string == 0)
+        return NULL;
+
+    memset(isdelim, 0, 256);
+    isdelim[0] = 1;
+
+    while (*delim)
+        {
+        isdelim[(unsigned char)(*delim)] = 1;
+        delim++;
+        }
+
+    while (!isdelim[(unsigned char)(**string)])
+        {
+        (*string)++;
+        }
+
+    if (**string)
+        {
+        **string = 0;
+        (*string)++;
+        }
+
+    return token;
+    }
+
 static unsigned char *ustrsep(char **p,const char *sep)
-    { return (unsigned char *)strsep((char **)p,sep); }
+    { return (unsigned char *)sstrsep((char **)p,sep); }
 
 static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
                  const unsigned char *iv,int in,
@@ -297,7 +328,7 @@
        if(line[0] == '#' || line[0] == '\n')
            continue;
        p=line;
-       cipher=strsep(&p,":");  
+       cipher=sstrsep(&p,":"); 
        key=ustrsep(&p,":");
        iv=ustrsep(&p,":");
        plaintext=ustrsep(&p,":");

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  [EMAIL PROTECTED]  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to