fix warnings
[openssl.git] / fips / fips_test_suite.c
index bcb2c7a0dcd879ca7eaffccc60dd02cfd55157aa..89914d721c42b445e7547926309b514498f56a1f 100644 (file)
@@ -408,7 +408,7 @@ static int FIPS_cmac_aes128_test()
              0xd7,0xd5,0x66,0xf5, 0xd2,0x8d,0xbd,0x2a, };
 
     unsigned char *out = NULL;
-    unsigned int outlen;
+    size_t outlen;
     CMAC_CTX *ctx = CMAC_CTX_new();
     int r = 0;
 
@@ -459,7 +459,7 @@ static int FIPS_cmac_aes192_test()
              0xb1,0x4a,0x0b,0xf2, 0xc6,0x3c,0x47,0x1f, };
 
     unsigned char *out = NULL;
-    unsigned int outlen;
+    size_t outlen;
     CMAC_CTX *ctx = CMAC_CTX_new();
     int r = 0;
 
@@ -511,7 +511,7 @@ static int FIPS_cmac_aes256_test()
              0xb0,0x86,0x37,0x5f, 0x15,0x60,0xba,0x1f, };
 
     unsigned char *out = NULL;
-    unsigned int outlen;
+    size_t outlen;
     CMAC_CTX *ctx = CMAC_CTX_new();
     int r = 0;
 
@@ -548,56 +548,6 @@ static int FIPS_cmac_aes256_test()
     return r;
     }
 
-/* CMAC-TDEA2: generate hash of known digest value and compare to known
-   precomputed correct hash
-*/
-static int FIPS_cmac_tdea2_test()
-    {
-    unsigned char key[] = { 0x4c,0xf1,0x51,0x34, 0xa2,0x85,0x0d,0xd5,
-                           0x8a,0x3d,0x10,0xba, 0x80,0x57,0x0d,0x38, };
-    unsigned char data[] = "Sample text";
-    unsigned char kaval[] =
-       {0x73, 0xf7, 0xa0, 0x48, 0xf8, 0x94, 0xed, 0xdd, 0x0a, 0xea, 0xea, 0x56, 0x1b, 0x61, 0x2e, 0x70,
-        0xb2, 0xfb, 0xec, 0xc6};
-
-    unsigned char *out = NULL;
-    unsigned int outlen;
-    CMAC_CTX *ctx = CMAC_CTX_new();
-    int r = 0;
-
-    ERR_clear_error();
-
-    if (!ctx)
-           goto end;
-    if (!CMAC_Init(ctx,key,sizeof(key),EVP_des_ede_cbc(),NULL))
-           goto end;
-    if (!CMAC_Update(ctx,data,sizeof(data)-1))
-           goto end;
-    /* This should return 1.  If not, there's a programming error... */
-    if (!CMAC_Final(ctx, out, &outlen))
-           goto end;
-    out = OPENSSL_malloc(outlen);
-    if (!CMAC_Final(ctx, out, &outlen))
-           goto end;
-#if 1
-    {
-    char *hexout = OPENSSL_malloc(outlen * 2 + 1);
-    bin2hex(out, outlen, hexout);
-    printf("CMAC-TDEA2: res = %s\n", hexout);
-    OPENSSL_free(hexout);
-    }
-    r = 1;
-#else
-    if (!memcmp(out,kaval,outlen))
-           r = 1;
-#endif
-    end:
-    CMAC_CTX_free(ctx);
-    if (out)
-         OPENSSL_free(out);
-    return r;
-    }
-
 /* CMAC-TDEA3: generate hash of known digest value and compare to known
    precomputed correct hash
 */
@@ -611,7 +561,7 @@ static int FIPS_cmac_tdea3_test()
            { 0xb4,0x06,0x4e,0xbf, 0x59,0x89,0xba,0x68, };
 
     unsigned char *out = NULL;
-    unsigned int outlen;
+    size_t outlen;
     CMAC_CTX *ctx = CMAC_CTX_new();
     int r = 0;