Cleanup EVP_CIPH/EP_CTRL duplicate defines
[openssl.git] / test / destest.c
index 389d0c8352473c076e919d7105bfaca8849a1cf9..84d753dde9b22517db9b3530446c08cb972d7b49 100644 (file)
@@ -35,8 +35,6 @@ int main(int argc, char *argv[])
 #else
 # include <openssl/des.h>
 
-# 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
@@ -216,7 +214,7 @@ static unsigned char cbc_ok[32] = {
 };
 
 # ifdef SCREW_THE_PARITY
-#  error "SCREW_THE_PARITY is not ment to be defined."
+#  error "SCREW_THE_PARITY is not meant to be defined."
 #  error "Original vectors are preserved for reference only."
 static unsigned char cbc2_key[8] =
     { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 };
@@ -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);
 }