Changeset 537
- Timestamp:
- 02/01/08 11:36:28
- Files:
-
- openpgpsdk/trunk/include/openpgpsdk/signature.h (modified) (1 diff)
- openpgpsdk/trunk/src/advanced/adv_signature.c (modified) (4 diffs)
- openpgpsdk/trunk/src/standard/std_signature.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/include/openpgpsdk/signature.h
r533 r537 46 46 ops_sig_type_t type); 47 47 void ops_signature_start_cleartext_signature(ops_create_signature_t *sig, 48 ops_secret_key_t *key,49 ops_hash_algorithm_t hash,50 ops_sig_type_t type);48 const ops_secret_key_t *key, 49 const ops_hash_algorithm_t hash, 50 const ops_sig_type_t type); 51 51 void ops_signature_start_message_signature(ops_create_signature_t *sig, 52 ops_secret_key_t *key, 53 ops_hash_algorithm_t hash, 54 ops_sig_type_t type); 55 /* 56 void ops_signature_start_signature(ops_create_signature_t *sig, 57 ops_secret_key_t *key, 58 ops_hash_algorithm_t hash, 59 ops_sig_type_t type); 60 */ 52 const ops_secret_key_t *key, 53 const ops_hash_algorithm_t hash, 54 const ops_sig_type_t type); 55 61 56 void ops_signature_add_data(ops_create_signature_t *sig,const void *buf, 62 57 size_t length); 63 58 ops_hash_t *ops_signature_get_hash(ops_create_signature_t *sig); 64 59 void ops_signature_hashed_subpackets_end(ops_create_signature_t *sig); 65 void ops_write_signature(ops_create_signature_t *sig, ops_public_key_t *key,66 ops_secret_key_t *skey,ops_create_info_t *opt);60 void ops_write_signature(ops_create_signature_t *sig,const ops_public_key_t *key, 61 const ops_secret_key_t *skey, const ops_create_info_t *opt); 67 62 void ops_signature_add_creation_time(ops_create_signature_t *sig,time_t when); 68 63 void ops_signature_add_issuer_key_id(ops_create_signature_t *sig, openpgpsdk/trunk/src/advanced/adv_signature.c
r533 r537 552 552 553 553 static void ops_signature_start_signature(ops_create_signature_t *sig, 554 ops_secret_key_t *key,555 ops_hash_algorithm_t hash,556 ops_sig_type_t type)554 const ops_secret_key_t *key, 555 const ops_hash_algorithm_t hash, 556 const ops_sig_type_t type) 557 557 { 558 558 sig->info=ops_create_info_new(); … … 575 575 576 576 void ops_signature_start_cleartext_signature(ops_create_signature_t *sig, 577 ops_secret_key_t *key,578 ops_hash_algorithm_t hash,579 ops_sig_type_t type)577 const ops_secret_key_t *key, 578 const ops_hash_algorithm_t hash, 579 const ops_sig_type_t type) 580 580 { 581 581 ops_signature_start_signature(sig,key,hash,type); … … 583 583 584 584 void ops_signature_start_message_signature(ops_create_signature_t *sig, 585 ops_secret_key_t *key,586 ops_hash_algorithm_t hash,587 ops_sig_type_t type)585 const ops_secret_key_t *key, 586 const ops_hash_algorithm_t hash, 587 const ops_sig_type_t type) 588 588 { 589 589 ops_signature_start_signature(sig,key,hash,type); … … 639 639 */ 640 640 641 void ops_write_signature(ops_create_signature_t *sig, ops_public_key_t *key,642 ops_secret_key_t *skey,ops_create_info_t *info)641 void ops_write_signature(ops_create_signature_t *sig, const ops_public_key_t *key, 642 const ops_secret_key_t *skey, const ops_create_info_t *info) 643 643 { 644 644 size_t l=ops_memory_get_length(sig->mem); openpgpsdk/trunk/src/standard/std_signature.c
r534 r537 60 60 // set up signature 61 61 sig=ops_create_signature_new(); 62 ops_signature_start_cleartext_signature(sig, (ops_secret_key_t *)skey,OPS_HASH_SHA1,OPS_SIG_BINARY);62 ops_signature_start_cleartext_signature(sig,skey,OPS_HASH_SHA1,OPS_SIG_BINARY); 63 63 64 64 // set up output file … … 91 91 ops_signature_hashed_subpackets_end(sig); 92 92 93 ops_write_signature(sig, (ops_public_key_t *)&skey->public_key,(ops_secret_key_t *)skey,cinfo);93 ops_write_signature(sig,&skey->public_key,skey,cinfo); 94 94 ops_writer_close(cinfo); 95 95 close(fd_out); … … 132 132 // set up signature 133 133 sig=ops_create_signature_new(); 134 ops_signature_start_message_signature(sig, (ops_secret_key_t *)skey, hash_alg, sig_type);134 ops_signature_start_message_signature(sig, skey, hash_alg, sig_type); 135 135 136 136 // set up output file … … 174 174 175 175 // write out sig 176 ops_write_signature(sig, (ops_public_key_t *)&skey->public_key,(ops_secret_key_t *)skey,cinfo);176 ops_write_signature(sig,&skey->public_key,skey,cinfo); 177 177 ops_writer_close(cinfo); 178 178 close(fd_out);
