fix
[oweals/gnunet.git] / src / util / test_crypto_rsa.c
index 4456d68f45a7d6929a18981e3c804f3c3268b782..ca3f69c35d614539061640448012b3a87a16618a 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -76,7 +76,7 @@ testEncryptDecrypt ()
       if (strncmp (TESTSTRING, result, strlen (TESTSTRING)) != 0)
         {
           printf ("%s != %.*s - testEncryptDecrypt failed!\n",
-                  TESTSTRING, MAX_TESTVAL, result);
+                  TESTSTRING, (int) MAX_TESTVAL, result);
           ok++;
           continue;
         }
@@ -227,8 +227,8 @@ testSignVerify ()
           continue;
         }
       if (GNUNET_SYSERR !=
-          GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_HELLO,
-                                    &purp, &sig, &pkey))
+          GNUNET_CRYPTO_rsa_verify
+          (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN, &purp, &sig, &pkey))
         {
           printf ("GNUNET_CRYPTO_rsa_verify failed to fail!\n");
           ok = GNUNET_SYSERR;
@@ -273,6 +273,7 @@ testSignPerformance ()
         }
     }
   printf ("%d RSA sign operations %llu ms\n", ITER,
+          (unsigned long long)
           GNUNET_TIME_absolute_get_duration (start).value);
   GNUNET_CRYPTO_rsa_key_free (hostkey);
   return ok;
@@ -288,14 +289,17 @@ testCreateFromFile ()
   struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded p2;
 
   key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE);
+  GNUNET_assert (NULL != key);
   GNUNET_CRYPTO_rsa_key_get_public (key, &p1);
   GNUNET_CRYPTO_rsa_key_free (key);
-  key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE);
+  key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE); 
+  GNUNET_assert (NULL != key);
   GNUNET_CRYPTO_rsa_key_get_public (key, &p2);
   GNUNET_assert (0 == memcmp (&p1, &p2, sizeof (p1)));
   GNUNET_CRYPTO_rsa_key_free (key);
   GNUNET_assert (0 == UNLINK (KEYFILE));
   key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE);
+  GNUNET_assert (NULL != key);
   GNUNET_CRYPTO_rsa_key_get_public (key, &p2);
   GNUNET_assert (0 != memcmp (&p1, &p2, sizeof (p1)));
   GNUNET_CRYPTO_rsa_key_free (key);