- Timestamp:
- 04/26/06 11:41:55 (3 years ago)
- Location:
- releases/opensc-0.11.0/src
- Files:
-
- 12 modified
-
pkcs11/openssl.c (modified) (1 diff)
-
pkcs11/pkcs11-display.c (modified) (1 diff)
-
pkcs11/sc-pkcs11.h (modified) (1 diff)
-
tests/print.c (modified) (3 diffs)
-
tools/eidenv.c (modified) (3 diffs)
-
tools/netkey-tool.c (modified) (5 diffs)
-
tools/opensc-explorer.c (modified) (2 diffs)
-
tools/opensc-tool.c (modified) (3 diffs)
-
tools/piv-tool.c (modified) (2 diffs)
-
tools/pkcs11-tool.c (modified) (2 diffs)
-
tools/pkcs15-crypt.c (modified) (2 diffs)
-
tools/pkcs15-tool.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
releases/opensc-0.11.0/src/pkcs11/openssl.c
r2436 r2915 192 192 * finishing with EVP_VerifyFinal(). 193 193 */ 194 CK_RV sc_pkcs11_verify_data( unsigned char *pubkey, int pubkey_len,194 CK_RV sc_pkcs11_verify_data(const unsigned char *pubkey, int pubkey_len, 195 195 CK_MECHANISM_TYPE mech, sc_pkcs11_operation_t *md, 196 196 unsigned char *data, int data_len, -
releases/opensc-0.11.0/src/pkcs11/pkcs11-display.c
r2524 r2915 135 135 if(size && value) { 136 136 X509_NAME *name; 137 name = d2i_X509_NAME(NULL, ( unsigned char **)&value, size);137 name = d2i_X509_NAME(NULL, (const unsigned char **)&value, size); 138 138 if(name) { 139 139 BIO *bio = BIO_new(BIO_s_file()); -
releases/opensc-0.11.0/src/pkcs11/sc-pkcs11.h
r2829 r2915 431 431 CK_RV sc_pkcs11_gen_keypair_soft(CK_KEY_TYPE keytype, CK_ULONG keybits, 432 432 struct sc_pkcs15_prkey *privkey, struct sc_pkcs15_pubkey *pubkey); 433 CK_RV sc_pkcs11_verify_data( unsigned char *pubkey, int pubkey_len,433 CK_RV sc_pkcs11_verify_data(const unsigned char *pubkey, int pubkey_len, 434 434 CK_MECHANISM_TYPE mech, sc_pkcs11_operation_t *md, 435 435 unsigned char *inp, int inp_len, -
releases/opensc-0.11.0/src/tests/print.c
r2690 r2915 66 66 } 67 67 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); 69 69 printf("\tPad char : 0x%02X\n", pin->pad_char); 70 70 printf("\tReference : %d\n", pin->reference); … … 123 123 printf("\n"); 124 124 if (obj->type == SC_PKCS15_TYPE_PRKEY_RSA) 125 printf("\tModLength : % d\n", prkey->modulus_length);125 printf("\tModLength : %lu\n", prkey->modulus_length); 126 126 printf("\tKey ref : %d\n", prkey->key_reference); 127 127 printf("\tNative : %s\n", prkey->native ? "yes" : "no"); … … 170 170 printf("\n"); 171 171 if (obj->type == SC_PKCS15_TYPE_PUBKEY_RSA) 172 printf("\tModLength : % d\n", pubkey->modulus_length);172 printf("\tModLength : %lu\n", pubkey->modulus_length); 173 173 printf("\tKey ref : %d\n", pubkey->key_reference); 174 174 printf("\tNative : %s\n", pubkey->native ? "yes" : "no"); -
releases/opensc-0.11.0/src/tools/eidenv.c
r2848 r2915 139 139 sc_path_t path; 140 140 int r, i; 141 char buff[512];141 unsigned char buff[512]; 142 142 143 143 if (stats) { … … 182 182 buff[r] = '\0'; 183 183 if (exec_program) { 184 char * cp;184 unsigned char * cp; 185 185 cp = malloc(strlen(esteid_data[i].env_name) + 186 strlen(buff) + 2);186 strlen((char *) buff) + 2); 187 187 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); 192 192 } 193 193 } else { … … 320 320 {NULL, 0, 0, 0, NULL, NULL}}; 321 321 322 char buff[512];322 unsigned char buff[512]; 323 323 int r; 324 324 -
releases/opensc-0.11.0/src/tools/netkey-tool.c
r2847 r2915 96 96 f->prop_attr_len!=5 || f->prop_attr[0]!=0x01 || f->prop_attr[1]!=0x80 97 97 ){ 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", 99 99 f->type, f->ef_structure, f->prop_attr_len, 100 100 f->prop_attr[0], f->prop_attr[1], f->prop_attr[2] … … 134 134 printf("\n"); 135 135 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); 137 137 138 138 sc_format_path(certlist[i].path,&p); … … 151 151 continue; 152 152 } 153 printf(", Maxlen=% u", f->size);153 printf(", Maxlen=%lu", f->size); 154 154 q=buf; 155 155 if(q[0]==0x30 && q[1]==0x82){ 156 156 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]); 158 158 if((c=d2i_X509(NULL,&q,f->size))){ 159 159 X509_NAME_get_text_by_NID(c->cert_info->subject, NID_commonName, buf,sizeof(buf)); … … 234 234 file->size!=12 || (len=sc_read_binary(card,0,buf,12,0))!=12 || buf[0]!=0x5A || buf[1]!=0x0A 235 235 ){ 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", 237 237 file->type, file->ef_structure, file->size 238 238 ); … … 589 589 for(i=0; i < sc_ctx_get_reader_count(ctx); ++i){ 590 590 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, 592 592 reader->driver->name, reader->slot_count); 593 593 } -
releases/opensc-0.11.0/src/tools/opensc-explorer.c
r2894 r2915 176 176 } 177 177 printf("\t%4s", st); 178 printf(" %5 d", file->size);178 printf(" %5lu", file->size); 179 179 if (file->namelen) { 180 180 printf("\tName: "); … … 419 419 } 420 420 } 421 printf("\n%-15s% dbytes\n", "File size:", file->size);421 printf("\n%-15s%lu bytes\n", "File size:", file->size); 422 422 423 423 if (file->type == SC_FILE_TYPE_DF) { -
releases/opensc-0.11.0/src/tools/opensc-tool.c
r2848 r2915 174 174 printf("ef structure: %s, ", structs[file->ef_structure]); 175 175 } 176 printf("size: % d\n", file->size);176 printf("size: %lu\n", file->size); 177 177 for (r = 0; r < depth; r++) 178 178 printf(" "); … … 311 311 apdu.datalen = apdu.lc; 312 312 if (len < apdu.lc) { 313 fprintf(stderr, "APDU too short (need % dbytes).\n",313 fprintf(stderr, "APDU too short (need %lu bytes).\n", 314 314 apdu.lc-len); 315 315 return 2; … … 325 325 apdu.cse = SC_APDU_CASE_3_SHORT; 326 326 if (len) { 327 fprintf(stderr, "APDU too long (% dbytes extra).\n", len);327 fprintf(stderr, "APDU too long (%lu bytes extra).\n", len); 328 328 return 2; 329 329 } -
releases/opensc-0.11.0/src/tools/piv-tool.c
r2846 r2915 280 280 apdu.datalen = apdu.lc; 281 281 if (len < apdu.lc) { 282 fprintf(stderr, "APDU too short (need % dbytes).\n",282 fprintf(stderr, "APDU too short (need %lu bytes).\n", 283 283 apdu.lc-len); 284 284 return 2; … … 294 294 apdu.cse = SC_APDU_CASE_3_SHORT; 295 295 if (len) { 296 fprintf(stderr, "APDU too long (% dbytes extra).\n", len);296 fprintf(stderr, "APDU too long (%lu bytes extra).\n", len); 297 297 return 2; 298 298 } -
releases/opensc-0.11.0/src/tools/pkcs11-tool.c
r2847 r2915 784 784 init_token(CK_SLOT_ID slot) 785 785 { 786 char token_label[33];786 unsigned char token_label[33]; 787 787 char new_buf[21], *new_pin = NULL; 788 788 CK_TOKEN_INFO info; … … 791 791 if (!opt_object_label) 792 792 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", 794 794 opt_object_label); 795 795 -
releases/opensc-0.11.0/src/tools/pkcs15-crypt.c
r2833 r2915 252 252 else { 253 253 fprintf(stderr, 254 "Invalid input size (% u bytes)\n",254 "Invalid input size (%lu bytes)\n", 255 255 len); 256 256 return SC_ERROR_INVALID_ARGUMENTS; … … 294 294 && !(opt_crypt_flags & SC_ALGORITHM_RSA_PAD_PKCS1) 295 295 && (size_t)c != key->modulus_length/8) { 296 fprintf(stderr, "Input has to be exactly % dbytes, when using no padding.\n",296 fprintf(stderr, "Input has to be exactly %lu bytes, when using no padding.\n", 297 297 key->modulus_length/8); 298 298 return 2; -
releases/opensc-0.11.0/src/tools/pkcs15-tool.c
r2860 r2915 217 217 size_t i; 218 218 219 printf("%s (% ibytes): <", kind, data_len);219 printf("%s (%lu bytes): <", kind, data_len); 220 220 for (i = 0; i < data_len; i++) 221 221 printf(" %02X", data[i]); … … 240 240 for (i=0; i < data_len; i++) 241 241 fprintf(outf, "%c", data[i]); 242 printf("Dumping (% ibytes) to file <%s>: <", data_len, opt_outfile);242 printf("Dumping (%lu bytes) to file <%s>: <", data_len, opt_outfile); 243 243 for (i=0; i < data_len; i++) 244 244 printf(" %02X", data[i]); … … 246 246 fclose(outf); 247 247 } else { 248 printf("%s (% ibytes): <", kind, data_len);248 printf("%s (%lu bytes): <", kind, data_len); 249 249 for (i=0; i < data_len; i++) 250 250 printf(" %02X", data[i]); … … 412 412 } 413 413 printf("\n"); 414 printf("\tModLength : % d\n", prkey->modulus_length);414 printf("\tModLength : %lu\n", prkey->modulus_length); 415 415 printf("\tKey ref : %d\n", prkey->key_reference); 416 416 printf("\tNative : %s\n", prkey->native ? "yes" : "no"); … … 470 470 } 471 471 printf("\n"); 472 printf("\tModLength : % d\n", pubkey->modulus_length);472 printf("\tModLength : %lu\n", pubkey->modulus_length); 473 473 printf("\tKey ref : %d\n", pubkey->key_reference); 474 474 printf("\tNative : %s\n", pubkey->native ? "yes" : "no"); … … 635 635 636 636 if (pubkey->algorithm == SC_ALGORITHM_RSA) { 637 char buf[2048];638 char *uu;637 unsigned char buf[2048]; 638 unsigned char *uu; 639 639 uint32_t len; 640 640 uint32_t n; … … 645 645 buf[3]=7; 646 646 647 len = sprintf( buf+4,"ssh-rsa");647 len = sprintf((char *) buf+4,"ssh-rsa"); 648 648 len+=4; 649 649 … … 687 687 688 688 if (pubkey->algorithm == SC_ALGORITHM_DSA) { 689 char buf[2048];690 char *uu;689 unsigned char buf[2048]; 690 unsigned char *uu; 691 691 uint32_t len; 692 692 uint32_t n; … … 697 697 buf[3]=7; 698 698 699 len = sprintf( buf+4,"ssh-dss");699 len = sprintf((char *) buf+4,"ssh-dss"); 700 700 len+=4; 701 701 … … 883 883 } 884 884 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", 886 886 pin->min_length, pin->max_length, pin->stored_length); 887 887 printf("\tPad char : 0x%02X\n", pin->pad_char);
