Print this page
6658907 digest(1) and mac(1) could benefit from being 64-bit programs

@@ -17,15 +17,15 @@
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * CDDL HEADER END
  */
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident   "@(#)digest.c   1.11    07/10/04 SMI"
+#pragma ident   "@(#)digest.c   1.12    08/03/20 SMI"
 
 /*
  * digest.c
  *
  * Implements digest(1) and mac(1) commands

@@ -369,11 +369,11 @@
         CK_SESSION_HANDLE hSession = CK_INVALID_HANDLE;
         CK_BYTE_PTR resultbuf = NULL;
         CK_ULONG resultlen;
         CK_BYTE_PTR     pkeydata = NULL;
         CK_OBJECT_HANDLE key = (CK_OBJECT_HANDLE) 0;
-        int keylen = 0;         /* key length */
+        size_t keylen = 0;              /* key length */
         char *resultstr = NULL; /* result in hex string */
         int resultstrlen;       /* result string length */
         int i;
         int exitcode = EXIT_SUCCESS;            /* return code */
         int slot, mek;                  /* index variables */

@@ -415,20 +415,20 @@
                                     !strlen(token_label)) {
                                         token_label = pkcs11_default_token();
                                 }
 
                                 status = pkcs11_get_pass(token_label,
-                                    (char **)&pkeydata, (size_t *)&keylen,
+                                    (char **)&pkeydata, &keylen,
                                     0, B_FALSE);
                         } else if (keyfile != NULL) {
                                 /* get the key file */
                                 status = pkcs11_read_data(keyfile,
-                                    (void **)&pkeydata, (size_t *)&keylen);
+                                    (void **)&pkeydata, &keylen);
                         } else {
                                 /* get the key from input */
                                 status = pkcs11_get_pass(NULL,
-                                    (char **)&pkeydata, (size_t *)&keylen,
+                                    (char **)&pkeydata, &keylen,
                                     0, B_FALSE);
                         }
 
                         if (status == -1 || keylen == 0 || pkeydata == NULL) {
                                 cryptoerror(LOG_STDERR,