X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=test%2Fdestest.c;h=877f71d3fb96146e15db48714a200c1acab8d257;hp=389d0c8352473c076e919d7105bfaca8849a1cf9;hb=6493e4801e9edbe1ad1e256d4ce9cd55c8aa2242;hpb=440e5d805f449d662520313b33fd90aeee86980b diff --git a/test/destest.c b/test/destest.c index 389d0c8352..877f71d3fb 100644 --- a/test/destest.c +++ b/test/destest.c @@ -35,8 +35,6 @@ int main(int argc, char *argv[]) #else # include -# define crypt(c,s) (DES_crypt((c),(s))) - /* tisk tisk - the test keys don't all have odd parity :-( */ /* test data */ # define NUM_TESTS 34 @@ -660,16 +658,31 @@ int main(int argc, char *argv[]) } printf("\n"); printf("fast crypt test "); - str = crypt("testing", "ef"); + str = DES_crypt("testing", "ef"); if (strcmp("efGnQx2725bI2", str) != 0) { printf("fast crypt error, %s should be efGnQx2725bI2\n", str); err = 1; } - str = crypt("bca76;23", "yA"); + str = DES_crypt("bca76;23", "yA"); if (strcmp("yA1Rp/1hZXIJk", str) != 0) { printf("fast crypt error, %s should be yA1Rp/1hZXIJk\n", str); err = 1; } + str = DES_crypt("testing", "y\202"); + if (str != NULL) { + printf("salt error only usascii are accepted\n"); + err = 1; + } + str = DES_crypt("testing", "\0A"); + if (str != NULL) { + printf("salt error cannot contain null terminator\n"); + err = 1; + } + str = DES_crypt("testing", "A"); + if (str != NULL) { + printf("salt error must be at least 2\n"); + err = 1; + } printf("\n"); return (err); }