~ubuntu-branches/ubuntu/maverick/nss/maverick

« back to all changes in this revision

Viewing changes to mozilla/security/nss/cmd/pk11util/pk11util.c

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2009-06-16 13:23:47 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090616132347-311ysb8oep74b98y
Tags: 3.12.3-0ubuntu1
* new upstream release 3.12.3 RTM (NSS_3_12_3_RTM) (LP: #387751)
* adjust patches to changed upstream code base
  - update debian/patches/38_kbsd.patch
* needs nspr >= 4.7.4
  - update debian/control
* update 85_security_load.patch to latest debian version
  - update debian/patches/85_security_load.patch
* add new symbols for 3.12.3
  - update debian/libnss3-1d.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
 
61
61
#include "pkcs11.h"
62
62
 
63
 
#include "pk11util.h"
 
63
#include "pk11table.h"
64
64
 
65
65
#ifndef O_BINARY
66
66
#define O_BINARY 0
381
381
        if (*error == 1) {
382
382
            return INVALID_INDEX;
383
383
        } else if (index == INVALID_INDEX) {
384
 
            fprintf(stderr, "%s: 0x%x is an invalid index\n",vname,index);
 
384
            fprintf(stderr, "%s: 0x%lx is an invalid index\n",vname,index);
385
385
            *error = 1;
386
386
        }
387
387
    }
395
395
    CK_ULONG elementSize;
396
396
 
397
397
    if (index >= (CK_ULONG)value->arraySize) {
398
 
        fprintf(stderr, "%s[%d]: index larger than array size (%d)\n",
 
398
        fprintf(stderr, "%s[%lu]: index larger than array size (%d)\n",
399
399
                vname, index, value->arraySize);
400
400
        return NULL;
401
401
    }
1046
1046
        printf(" Cryptoki Version: %d.%02d\n",
1047
1047
                VERSION(info->cryptokiVersion));
1048
1048
        printf(" Manufacturer ID: ");
1049
 
        printChars(info->manufacturerID,sizeof(info->manufacturerID));
 
1049
        printChars((char *)info->manufacturerID,
 
1050
        sizeof(info->manufacturerID));
1050
1051
        printFlags(" Flags: ", info->flags, ConstInfoFlags);
1051
1052
        printf(" Library Description: ");
1052
 
        printChars(info->libraryDescription,sizeof(info->libraryDescription));
 
1053
        printChars((char *)info->libraryDescription,
 
1054
        sizeof(info->libraryDescription));
1053
1055
        printf(" Library Version: %d.%02d\n",
1054
1056
                VERSION(info->libraryVersion));
1055
1057
        break;
1056
1058
    case ArgSlotInfo:
1057
1059
        slotInfo = (CK_SLOT_INFO *)ptr->data;
1058
1060
        printf(" Slot Description: ");
1059
 
        printChars(slotInfo->slotDescription,sizeof(slotInfo->slotDescription));
 
1061
        printChars((char *)slotInfo->slotDescription,
 
1062
        sizeof(slotInfo->slotDescription));
1060
1063
        printf(" Manufacturer ID: ");
1061
 
        printChars(slotInfo->manufacturerID,sizeof(slotInfo->manufacturerID));
 
1064
        printChars((char *)slotInfo->manufacturerID,
 
1065
        sizeof(slotInfo->manufacturerID));
1062
1066
        printFlags(" Flags: ", slotInfo->flags, ConstSlotFlags);
1063
1067
        printf(" Hardware Version: %d.%02d\n",
1064
1068
                VERSION(slotInfo->hardwareVersion));
1068
1072
    case ArgTokenInfo:
1069
1073
        tokenInfo = (CK_TOKEN_INFO *)ptr->data;
1070
1074
        printf(" Label: ");
1071
 
        printChars(tokenInfo->label,sizeof(tokenInfo->label));
 
1075
        printChars((char *) tokenInfo->label,sizeof(tokenInfo->label));
1072
1076
        printf(" Manufacturer ID: ");
1073
 
        printChars(tokenInfo->manufacturerID,sizeof(tokenInfo->manufacturerID));
 
1077
        printChars((char *)tokenInfo->manufacturerID,
 
1078
        sizeof(tokenInfo->manufacturerID));
1074
1079
        printf(" Model: ");
1075
 
        printChars(tokenInfo->model,sizeof(tokenInfo->model));
 
1080
        printChars((char *)tokenInfo->model,sizeof(tokenInfo->model));
1076
1081
        printf(" Serial Number: ");
1077
 
        printChars(tokenInfo->serialNumber,sizeof(tokenInfo->serialNumber));
 
1082
        printChars((char *)tokenInfo->serialNumber,
 
1083
        sizeof(tokenInfo->serialNumber));
1078
1084
        printFlags(" Flags: ", tokenInfo->flags, ConstTokenFlags);
1079
1085
        printf(" Max Session Count: ");
1080
1086
        printConst(tokenInfo->ulMaxSessionCount, ConstAvailableSizes, 1);
1099
1105
        printf(" Firmware Version: %d.%02d\n",
1100
1106
                VERSION(tokenInfo->firmwareVersion));
1101
1107
        printf(" UTC Time: ");
1102
 
        printChars(tokenInfo->utcTime,sizeof(tokenInfo->utcTime));
 
1108
        printChars((char *)tokenInfo->utcTime,sizeof(tokenInfo->utcTime));
1103
1109
        break;
1104
1110
    case ArgSessionInfo:
1105
1111
        sessionInfo = (CK_SESSION_INFO *)ptr->data;
1148
1154
        initArgs = (CK_C_INITIALIZE_ARGS *)ptr->data;
1149
1155
        printFlags(" Flags: ", initArgs->flags, ConstInitializeFlags);
1150
1156
        if (initArgs->LibraryParameters) {
1151
 
            printf("Params: %s\n",initArgs->LibraryParameters);
 
1157
            printf("Params: %s\n",(char *)initArgs->LibraryParameters);
1152
1158
        }
1153
1159
    case ArgFunctionList:
1154
1160
        functionList = (CK_FUNCTION_LIST *)ptr->data;
1609
1615
        if (!func) return CKR_CRYPTOKI_NOT_INITIALIZED;
1610
1616
        return func->C_GetSlotList((CK_BBOOL)*(CK_ULONG *)a[0]->data,
1611
1617
                                        (CK_SLOT_ID *)a[1]->data,
1612
 
                                        (CK_LONG *)a[2]->data);
 
1618
                                        (CK_ULONG *)a[2]->data);
1613
1619
    case F_C_GetSlotInfo:
1614
1620
        if (!func) return CKR_CRYPTOKI_NOT_INITIALIZED;
1615
1621
        return func->C_GetSlotInfo(*(CK_ULONG *)a[0]->data,