X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fevp%2Fevp_test.c;h=df02ea6047861a72031074a933923d067b97b9aa;hp=1fdc9976190edcdf3aa7e9deca97d52adea626b5;hb=5b46eee0f552012fd13ff469f0d81ae158f77fd1;hpb=e5e6a94fbf9fbf2dcc3f3f6865b2e4b584b282fa;ds=sidebyside diff --git a/crypto/evp/evp_test.c b/crypto/evp/evp_test.c index 1fdc997619..df02ea6047 100644 --- a/crypto/evp/evp_test.c +++ b/crypto/evp/evp_test.c @@ -85,8 +85,39 @@ static int convert(unsigned char *s) 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 @@ int main(int argc,char **argv) if(line[0] == '#' || line[0] == '\n') continue; p=line; - cipher=strsep(&p,":"); + cipher=sstrsep(&p,":"); key=ustrsep(&p,":"); iv=ustrsep(&p,":"); plaintext=ustrsep(&p,":");