gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r1051 - GNUnet/src/util


From: grothoff
Subject: [GNUnet-SVN] r1051 - GNUnet/src/util
Date: Sun, 26 Jun 2005 04:52:57 -0700 (PDT)

Author: grothoff
Date: 2005-06-26 04:52:55 -0700 (Sun, 26 Jun 2005)
New Revision: 1051

Modified:
   GNUnet/src/util/kblockkey_test.c
Log:
fixing testcase

Modified: GNUnet/src/util/kblockkey_test.c
===================================================================
--- GNUnet/src/util/kblockkey_test.c    2005-06-26 11:40:36 UTC (rev 1050)
+++ GNUnet/src/util/kblockkey_test.c    2005-06-26 11:52:55 UTC (rev 1051)
@@ -1,3 +1,23 @@
+/*
+     This file is part of GNUnet.
+     Copyright (C) 2004, 2005 Christian Grothoff (and other contributing 
authors)
+
+     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
+     option) any later version.
+
+     GNUnet is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
 /**
  * @file util/kblockkey_test.c
  * @brief testcase for util/kblockkey.c
@@ -146,8 +166,9 @@
   return ok;
 }
 
-static int testPrivateKeyEncoding(struct PrivateKey * hostkey) {
+static int testPrivateKeyEncoding(const struct PrivateKey * hostkey) {
   PrivateKeyEncoded * encoding;
+  struct PrivateKey * hostkey2;
   PublicKey pkey;
   RSAEncryptedData target;
   char result[MAX_TESTVAL];
@@ -177,19 +198,19 @@
       ok = SYSERR;
       continue;
     }
-    hostkey = decodePrivateKey(encoding);
+    hostkey2 = decodePrivateKey(encoding);
     FREE(encoding);
-    if (SYSERR == decryptPrivateKey(hostkey,
+    if (SYSERR == decryptPrivateKey(hostkey2,
                                    &target,
                                    result,
                                    strlen(TESTSTRING)+1)) {
       fprintf(stderr,
              "decryptPrivateKey returned SYSERR\n");
       ok = SYSERR;
-      freePrivateKey(hostkey);
+      freePrivateKey(hostkey2);
       continue;
     }
-    freePrivateKey(hostkey);
+    freePrivateKey(hostkey2);
     if (strncmp(TESTSTRING, result,
                strlen(TESTSTRING)) != 0) {
       printf("%s != %.*s - testEncryptDecrypt failed!\n",





reply via email to

[Prev in Thread] Current Thread [Next in Thread]