mpmul.[ch]: Move internal `HWM' and `LWM' constants to implementation.
[u/mdw/catacomb] / cookie.c
index 9b32389..8fa07da 100644 (file)
--- a/cookie.c
+++ b/cookie.c
@@ -7,7 +7,7 @@
  * (c) 1999 Mark Wooding
  */
 
-/*----- Licensing notice --------------------------------------------------* 
+/*----- Licensing notice --------------------------------------------------*
  *
  * This file is part of Catacomb.
  *
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * Catacomb 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 Catacomb; if not, write to the Free Software Foundation,
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -28,6 +28,8 @@
 
 /*----- Header files ------------------------------------------------------*/
 
+#define _FILE_OFFSET_BITS 64
+
 #include "config.h"
 
 #include <errno.h>
@@ -188,9 +190,9 @@ static gmac *getmac(key *k, const char *app)
 
   /* --- Unlock the key --- */
 
-  kp.kd.e = KENC_BINARY;
+  kp.e = KENC_BINARY;
   kp.p = &kb;
-  if ((e = key_unpack(&kp, &k->k, &t)) != 0) {
+  if ((e = key_unpack(&kp, k->k, &t)) != 0) {
     die(EXIT_FAILURE, "error unpacking key `%s': %s",
        t.buf, key_strerror(e));
   }
@@ -224,7 +226,7 @@ static int cmd_gen(int argc, char *argv[])
   dstr d = DSTR_INIT;
   octet buf[COOKIE_SZ];
   base64_ctx b;
-  
+
   /* --- Various useful flag bits --- */
 
 #define f_bogus 1u
@@ -386,7 +388,7 @@ static int cmd_verify(int argc, char *argv[])
       case 'm':
        if (!(minbits = atoi(optarg)) || minbits % 8)
          die(EXIT_FAILURE, "bad number of bits: `%s'", optarg);
-       break;  
+       break;
 
       /* --- Miscellaneous flags --- */
 
@@ -402,7 +404,7 @@ static int cmd_verify(int argc, char *argv[])
       case 'v':
        v++;
        break;
-       
+
       /* --- Other things are bogus --- */
 
       default:
@@ -687,6 +689,6 @@ int main(int argc, char *argv[])
 
 #undef f_bogus
 #undef f_forever
-}    
+}
 
 /*----- That's all, folks -------------------------------------------------*/