Changeset 2915 for releases

Show
Ignore:
Timestamp:
04/26/06 11:41:55 (3 years ago)
Author:
aj
Message:

fix signed and size_t warnings.

Location:
releases/opensc-0.11.0/src
Files:
12 modified

Legend:

Unmodified
Added
Removed
  • releases/opensc-0.11.0/src/pkcs11/openssl.c

    r2436 r2915  
    192192 *   finishing with EVP_VerifyFinal(). 
    193193 */ 
    194 CK_RV sc_pkcs11_verify_data(unsigned char *pubkey, int pubkey_len, 
     194CK_RV sc_pkcs11_verify_data(const unsigned char *pubkey, int pubkey_len, 
    195195                        CK_MECHANISM_TYPE mech, sc_pkcs11_operation_t *md, 
    196196                        unsigned char *data, int data_len, 
  • releases/opensc-0.11.0/src/pkcs11/pkcs11-display.c

    r2524 r2915  
    135135  if(size && value) { 
    136136    X509_NAME *name; 
    137     name = d2i_X509_NAME(NULL, (unsigned char **)&value, size); 
     137    name = d2i_X509_NAME(NULL, (const unsigned char **)&value, size); 
    138138    if(name) { 
    139139      BIO *bio = BIO_new(BIO_s_file()); 
  • releases/opensc-0.11.0/src/pkcs11/sc-pkcs11.h

    r2829 r2915  
    431431CK_RV sc_pkcs11_gen_keypair_soft(CK_KEY_TYPE keytype, CK_ULONG keybits, 
    432432        struct sc_pkcs15_prkey *privkey, struct sc_pkcs15_pubkey *pubkey); 
    433 CK_RV sc_pkcs11_verify_data(unsigned char *pubkey, int pubkey_len, 
     433CK_RV sc_pkcs11_verify_data(const unsigned char *pubkey, int pubkey_len, 
    434434        CK_MECHANISM_TYPE mech, sc_pkcs11_operation_t *md, 
    435435        unsigned char *inp, int inp_len, 
  • releases/opensc-0.11.0/src/tests/print.c

    r2690 r2915  
    6666                } 
    6767        printf("\n"); 
    68         printf("\tLength      : min_len:%d, max_len:%d, stored_len:%d\n", pin->min_length, pin->max_length, pin->stored_length); 
     68        printf("\tLength      : min_len:%lu, max_len:%lu, stored_len:%lu\n", pin->min_length, pin->max_length, pin->stored_length); 
    6969        printf("\tPad char    : 0x%02X\n", pin->pad_char); 
    7070        printf("\tReference   : %d\n", pin->reference); 
     
    123123        printf("\n"); 
    124124        if (obj->type == SC_PKCS15_TYPE_PRKEY_RSA) 
    125                 printf("\tModLength   : %d\n", prkey->modulus_length); 
     125                printf("\tModLength   : %lu\n", prkey->modulus_length); 
    126126        printf("\tKey ref     : %d\n", prkey->key_reference); 
    127127        printf("\tNative      : %s\n", prkey->native ? "yes" : "no"); 
     
    170170        printf("\n"); 
    171171        if (obj->type == SC_PKCS15_TYPE_PUBKEY_RSA) 
    172                 printf("\tModLength   : %d\n", pubkey->modulus_length); 
     172                printf("\tModLength   : %lu\n", pubkey->modulus_length); 
    173173        printf("\tKey ref     : %d\n", pubkey->key_reference); 
    174174        printf("\tNative      : %s\n", pubkey->native ? "yes" : "no"); 
  • releases/opensc-0.11.0/src/tools/eidenv.c

    r2848 r2915  
    139139        sc_path_t path; 
    140140        int r, i; 
    141         char buff[512]; 
     141        unsigned char buff[512]; 
    142142 
    143143        if (stats) { 
     
    182182                buff[r] = '\0'; 
    183183                if (exec_program) { 
    184                         char * cp; 
     184                        unsigned char * cp; 
    185185                        cp = malloc(strlen(esteid_data[i].env_name) +  
    186                         strlen(buff) + 2); 
     186                                strlen((char *) buff) + 2); 
    187187                        if (cp) {  
    188                                 strcpy(cp,esteid_data[i].env_name); 
    189                                 strcat(cp,"="); 
    190                                 strcat(cp,buff); 
    191                                 putenv(cp); 
     188                                strcpy((char *) cp,esteid_data[i].env_name); 
     189                                strcat((char *) cp,"="); 
     190                                strcat((char *) cp,(char *) buff); 
     191                                putenv((char *) cp); 
    192192                        } 
    193193                } else { 
     
    320320                {NULL, 0, 0, 0, NULL, NULL}}; 
    321321 
    322         char buff[512]; 
     322        unsigned char buff[512]; 
    323323        int r; 
    324324 
  • releases/opensc-0.11.0/src/tools/netkey-tool.c

    r2847 r2915  
    9696           f->prop_attr_len!=5 || f->prop_attr[0]!=0x01 || f->prop_attr[1]!=0x80 
    9797        ){ 
    98                 printf("\nInvald PIN-file: Type=%d, EF-Structure=%d, Prop-Len=%d %02X:%02X:%02X\n", 
     98                printf("\nInvald PIN-file: Type=%d, EF-Structure=%d, Prop-Len=%lu %02X:%02X:%02X\n", 
    9999                        f->type, f->ef_structure, f->prop_attr_len, 
    100100                        f->prop_attr[0], f->prop_attr[1], f->prop_attr[2] 
     
    134134        printf("\n"); 
    135135        for(i=0;i<sizeof(certlist)/sizeof(certlist[0]);++i){ 
    136                 printf("Certificate %d: %s", i, certlist[i].label); fflush(stdout); 
     136                printf("Certificate %lu: %s", i, certlist[i].label); fflush(stdout); 
    137137 
    138138                sc_format_path(certlist[i].path,&p); 
     
    151151                        continue; 
    152152                } 
    153                 printf(", Maxlen=%u", f->size); 
     153                printf(", Maxlen=%lu", f->size); 
    154154                q=buf; 
    155155                if(q[0]==0x30 && q[1]==0x82){ 
    156156                        if(q[4]==6 && q[5]<10 && q[q[5]+6]==0x30 && q[q[5]+7]==0x82) q+=q[5]+6; 
    157                         printf(", Len=%u\n", (q[2]<<8)|q[3]); 
     157                        printf(", Len=%d\n", (q[2]<<8)|q[3]); 
    158158                        if((c=d2i_X509(NULL,&q,f->size))){ 
    159159                                X509_NAME_get_text_by_NID(c->cert_info->subject, NID_commonName, buf,sizeof(buf)); 
     
    234234           file->size!=12 || (len=sc_read_binary(card,0,buf,12,0))!=12 || buf[0]!=0x5A || buf[1]!=0x0A 
    235235        ){ 
    236                 printf("\nInvald Serial-Number: Type=%d, EF-Structure=%d, Size=%d\n", 
     236                printf("\nInvald Serial-Number: Type=%d, EF-Structure=%d, Size=%lu\n", 
    237237                        file->type, file->ef_structure, file->size 
    238238                ); 
     
    589589        for(i=0; i < sc_ctx_get_reader_count(ctx); ++i){ 
    590590                sc_reader_t *reader = sc_ctx_get_reader(ctx, i); 
    591                 printf("%d: %s, Driver: %s, %d Slot(s)\n", i, reader->name, 
     591                printf("%lu: %s, Driver: %s, %d Slot(s)\n", i, reader->name, 
    592592                        reader->driver->name, reader->slot_count); 
    593593        } 
  • releases/opensc-0.11.0/src/tools/opensc-explorer.c

    r2894 r2915  
    176176        } 
    177177        printf("\t%4s", st); 
    178         printf(" %5d", file->size); 
     178        printf(" %5lu", file->size); 
    179179        if (file->namelen) { 
    180180                printf("\tName: "); 
     
    419419                } 
    420420        } 
    421         printf("\n%-15s%d bytes\n", "File size:", file->size); 
     421        printf("\n%-15s%lu bytes\n", "File size:", file->size); 
    422422 
    423423        if (file->type == SC_FILE_TYPE_DF) { 
  • releases/opensc-0.11.0/src/tools/opensc-tool.c

    r2848 r2915  
    174174                printf("ef structure: %s, ", structs[file->ef_structure]); 
    175175        } 
    176         printf("size: %d\n", file->size); 
     176        printf("size: %lu\n", file->size); 
    177177        for (r = 0; r < depth; r++) 
    178178                printf("  "); 
     
    311311                        apdu.datalen = apdu.lc; 
    312312                        if (len < apdu.lc) { 
    313                                 fprintf(stderr, "APDU too short (need %d bytes).\n", 
     313                                fprintf(stderr, "APDU too short (need %lu bytes).\n", 
    314314                                        apdu.lc-len); 
    315315                                return 2; 
     
    325325                                apdu.cse = SC_APDU_CASE_3_SHORT; 
    326326                        if (len) { 
    327                                 fprintf(stderr, "APDU too long (%d bytes extra).\n", len); 
     327                                fprintf(stderr, "APDU too long (%lu bytes extra).\n", len); 
    328328                                return 2; 
    329329                        } 
  • releases/opensc-0.11.0/src/tools/piv-tool.c

    r2846 r2915  
    280280                        apdu.datalen = apdu.lc; 
    281281                        if (len < apdu.lc) { 
    282                                 fprintf(stderr, "APDU too short (need %d bytes).\n", 
     282                                fprintf(stderr, "APDU too short (need %lu bytes).\n", 
    283283                                        apdu.lc-len); 
    284284                                return 2; 
     
    294294                                apdu.cse = SC_APDU_CASE_3_SHORT; 
    295295                        if (len) { 
    296                                 fprintf(stderr, "APDU too long (%d bytes extra).\n", len); 
     296                                fprintf(stderr, "APDU too long (%lu bytes extra).\n", len); 
    297297                                return 2; 
    298298                        } 
  • releases/opensc-0.11.0/src/tools/pkcs11-tool.c

    r2847 r2915  
    784784init_token(CK_SLOT_ID slot) 
    785785{ 
    786         char token_label[33]; 
     786        unsigned char token_label[33]; 
    787787        char new_buf[21], *new_pin = NULL; 
    788788        CK_TOKEN_INFO   info; 
     
    791791        if (!opt_object_label) 
    792792                fatal("The token label must be specified using --label\n"); 
    793         snprintf(token_label, sizeof (token_label), "%-32.32s", 
     793        snprintf((char *) token_label, sizeof (token_label), "%-32.32s", 
    794794                        opt_object_label); 
    795795 
  • releases/opensc-0.11.0/src/tools/pkcs15-crypt.c

    r2833 r2915  
    252252                        else { 
    253253                                fprintf(stderr, 
    254                                         "Invalid input size (%u bytes)\n", 
     254                                        "Invalid input size (%lu bytes)\n", 
    255255                                        len); 
    256256                                return SC_ERROR_INVALID_ARGUMENTS; 
     
    294294         && !(opt_crypt_flags & SC_ALGORITHM_RSA_PAD_PKCS1) 
    295295         && (size_t)c != key->modulus_length/8) { 
    296                 fprintf(stderr, "Input has to be exactly %d bytes, when using no padding.\n", 
     296                fprintf(stderr, "Input has to be exactly %lu bytes, when using no padding.\n", 
    297297                        key->modulus_length/8); 
    298298                return 2; 
  • releases/opensc-0.11.0/src/tools/pkcs15-tool.c

    r2860 r2915  
    217217        size_t i; 
    218218         
    219         printf("%s (%i bytes): <", kind, data_len); 
     219        printf("%s (%lu bytes): <", kind, data_len); 
    220220        for (i = 0; i < data_len; i++) 
    221221                printf(" %02X", data[i]); 
     
    240240                for (i=0; i < data_len; i++) 
    241241                        fprintf(outf, "%c", data[i]); 
    242                 printf("Dumping (%i bytes) to file <%s>: <", data_len, opt_outfile); 
     242                printf("Dumping (%lu bytes) to file <%s>: <", data_len, opt_outfile); 
    243243                for (i=0; i < data_len; i++) 
    244244                        printf(" %02X", data[i]); 
     
    246246                fclose(outf); 
    247247        } else { 
    248                 printf("%s (%i bytes): <", kind, data_len); 
     248                printf("%s (%lu bytes): <", kind, data_len); 
    249249                for (i=0; i < data_len; i++) 
    250250                        printf(" %02X", data[i]); 
     
    412412                } 
    413413        printf("\n"); 
    414         printf("\tModLength   : %d\n", prkey->modulus_length); 
     414        printf("\tModLength   : %lu\n", prkey->modulus_length); 
    415415        printf("\tKey ref     : %d\n", prkey->key_reference); 
    416416        printf("\tNative      : %s\n", prkey->native ? "yes" : "no"); 
     
    470470                } 
    471471        printf("\n"); 
    472         printf("\tModLength   : %d\n", pubkey->modulus_length); 
     472        printf("\tModLength   : %lu\n", pubkey->modulus_length); 
    473473        printf("\tKey ref     : %d\n", pubkey->key_reference); 
    474474        printf("\tNative      : %s\n", pubkey->native ? "yes" : "no"); 
     
    635635 
    636636        if (pubkey->algorithm == SC_ALGORITHM_RSA) { 
    637                 char buf[2048]; 
    638                 char *uu; 
     637                unsigned char buf[2048]; 
     638                unsigned char *uu; 
    639639                uint32_t len; 
    640640                uint32_t n; 
     
    645645                buf[3]=7; 
    646646 
    647                 len = sprintf(buf+4,"ssh-rsa"); 
     647                len = sprintf((char *) buf+4,"ssh-rsa"); 
    648648                len+=4; 
    649649 
     
    687687 
    688688        if (pubkey->algorithm == SC_ALGORITHM_DSA) { 
    689                 char buf[2048]; 
    690                 char *uu; 
     689                unsigned char buf[2048]; 
     690                unsigned char *uu; 
    691691                uint32_t len; 
    692692                uint32_t n; 
     
    697697                buf[3]=7; 
    698698 
    699                 len = sprintf(buf+4,"ssh-dss"); 
     699                len = sprintf((char *) buf+4,"ssh-dss"); 
    700700                len+=4; 
    701701 
     
    883883                } 
    884884        printf("\n"); 
    885         printf("\tLength    : min_len:%d, max_len:%d, stored_len:%d\n", 
     885        printf("\tLength    : min_len:%lu, max_len:%lu, stored_len:%lu\n", 
    886886                                pin->min_length, pin->max_length, pin->stored_length); 
    887887        printf("\tPad char  : 0x%02X\n", pin->pad_char);