Changeset 534
- Timestamp:
- 02/01/08 09:40:41
- Files:
-
- openpgpsdk/trunk/include/openpgpsdk/armour.h (modified) (1 diff)
- openpgpsdk/trunk/include/openpgpsdk/crypto.h (modified) (2 diffs)
- openpgpsdk/trunk/src/advanced/adv_armour.c (modified) (1 diff)
- openpgpsdk/trunk/src/standard/Makefile.template (modified) (1 diff)
- openpgpsdk/trunk/src/standard/std_signature.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/include/openpgpsdk/armour.h
r533 r534 10 10 void ops_writer_push_clearsigned(ops_create_info_t *info, 11 11 ops_create_signature_t *sig); 12 void ops_writer_push_armoured_message(ops_create_info_t *info, 13 ops_create_signature_t *sig); 12 void ops_writer_push_armoured_message(ops_create_info_t *info); 14 13 void ops_writer_switch_to_armoured_signature(ops_create_info_t *info); openpgpsdk/trunk/include/openpgpsdk/crypto.h
r516 r534 5 5 #define OPS_CRYPTO_H 6 6 7 #include "keyring.h" 7 8 #include "util.h" 8 9 #include "packet.h" … … 138 139 const struct ops_key_data *key); 139 140 141 void ops_encrypt_file(const char* input_filename, const char* output_filename, const ops_key_data_t *pub_key, const int use_armour); 142 140 143 #endif openpgpsdk/trunk/src/advanced/adv_armour.c
r533 r534 1100 1100 } 1101 1101 1102 void ops_writer_push_armoured_message(ops_create_info_t *info ,1103 ops_create_signature_t *sig)1104 { 1105 static char header[]="-----BEGIN PGP MESSAGE-----\r\n Hash:";1106 const char *hash=ops_text_from_hash(ops_signature_get_hash(sig)); 1102 void ops_writer_push_armoured_message(ops_create_info_t *info) 1103 // ops_create_signature_t *sig) 1104 { 1105 static char header[]="-----BEGIN PGP MESSAGE-----\r\n"; 1106 1107 1107 base64_arg_t *base64; 1108 1108 1109 1109 ops_write(header,sizeof header-1,info); 1110 ops_write(hash,strlen(hash),info); 1111 ops_write("\r\n\r\n",4,info); 1110 ops_write("\r\n",2,info); 1112 1111 base64=ops_mallocz(sizeof *base64); 1113 1112 base64->checksum=CRC24_INIT; openpgpsdk/trunk/src/standard/Makefile.template
r530 r534 11 11 all: Makefile headers .depend lib 12 12 13 LIBOBJS = std_keyring.o std_print.o std_signature.o 13 LIBOBJS = std_keyring.o std_print.o std_signature.o std_encrypt.o 14 14 15 15 headers: openpgpsdk/trunk/src/standard/std_signature.c
r533 r534 105 105 106 106 int fd_out=0; 107 ops_create_info_t *cinfo _out=NULL;107 ops_create_info_t *cinfo=NULL; 108 108 109 109 ops_hash_algorithm_t hash_alg=OPS_HASH_SHA1; … … 133 133 sig=ops_create_signature_new(); 134 134 ops_signature_start_message_signature(sig,(ops_secret_key_t *)skey, hash_alg, sig_type); 135 135 136 // set up output file 136 cinfo _out=ops_create_info_new();137 ops_writer_set_fd(cinfo _out,fd_out);137 cinfo=ops_create_info_new(); 138 ops_writer_set_fd(cinfo,fd_out); 138 139 139 140 // set armoured/not armoured here 140 141 if (use_armour) 141 ops_writer_push_armoured_message(cinfo _out,sig);142 ops_writer_push_armoured_message(cinfo); 142 143 143 144 if (debug) … … 145 146 146 147 // write one_pass_sig 147 ops_write_one_pass_sig(skey, hash_alg, sig_type, cinfo _out);148 ops_write_one_pass_sig(skey, hash_alg, sig_type, cinfo); 148 149 149 150 // hash file contents … … 156 157 { fprintf(stderr,"** Writing out data now\n"); } 157 158 158 ops_write_literal_data_from_buf(ops_memory_get_data(mem_buf), ops_memory_get_length(mem_buf), OPS_LDT_BINARY, cinfo _out);159 ops_write_literal_data_from_buf(ops_memory_get_data(mem_buf), ops_memory_get_length(mem_buf), OPS_LDT_BINARY, cinfo); 159 160 160 161 if (debug) … … 173 174 174 175 // write out sig 175 ops_write_signature(sig,(ops_public_key_t *)&skey->public_key,(ops_secret_key_t *)skey,cinfo _out);176 ops_writer_close(cinfo _out);176 ops_write_signature(sig,(ops_public_key_t *)&skey->public_key,(ops_secret_key_t *)skey,cinfo); 177 ops_writer_close(cinfo); 177 178 close(fd_out); 178 179 179 // ops_writer_close(cinfo_ld);180 181 180 // tidy up 181 ops_create_info_delete(cinfo); 182 182 ops_create_signature_delete(sig); 183 183 ops_memory_free(mem_buf);
