Changeset 573
- Timestamp:
- 08/07/08 13:49:21
- Files:
-
- openpgpsdk/trunk/include/openpgpsdk/armour.h (modified) (1 diff)
- openpgpsdk/trunk/include/openpgpsdk/errors.h (modified) (1 diff)
- openpgpsdk/trunk/include/openpgpsdk/signature.h (modified) (2 diffs)
- openpgpsdk/trunk/src/lib/adv_armour.c (modified) (7 diffs)
- openpgpsdk/trunk/src/lib/adv_create.c (modified) (7 diffs)
- openpgpsdk/trunk/src/lib/adv_fingerprint.c (modified) (1 diff)
- openpgpsdk/trunk/src/lib/adv_openssl_crypto.c (modified) (1 diff)
- openpgpsdk/trunk/src/lib/adv_signature.c (modified) (7 diffs)
- openpgpsdk/trunk/src/lib/std_signature.c (modified) (9 diffs)
- openpgpsdk/trunk/tests/test_rsa_decrypt.c (modified) (2 diffs)
- openpgpsdk/trunk/tests/test_rsa_encrypt.c (modified) (1 diff)
- openpgpsdk/trunk/tests/test_rsa_keys.c (modified) (1 diff)
- openpgpsdk/trunk/tests/test_rsa_signature.c (modified) (5 diffs)
- openpgpsdk/trunk/tests/tests.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/include/openpgpsdk/armour.h
r570 r573 29 29 30 30 void ops_reader_pop_dearmour(ops_parse_info_t *parse_info); 31 voidops_writer_push_clearsigned(ops_create_info_t *info,31 ops_boolean_t ops_writer_push_clearsigned(ops_create_info_t *info, 32 32 ops_create_signature_t *sig); 33 33 void ops_writer_push_armoured_message(ops_create_info_t *info); 34 voidops_writer_switch_to_armoured_signature(ops_create_info_t *info);34 ops_boolean_t ops_writer_switch_to_armoured_signature(ops_create_info_t *info); 35 35 36 36 typedef enum openpgpsdk/trunk/include/openpgpsdk/errors.h
r570 r573 112 112 113 113 #define OPS_SYSTEM_ERROR_1(err,code,syscall,fmt,arg) do { ops_push_error(err,OPS_E_SYSTEM_ERROR,errno,__FILE__,__LINE__,syscall); ops_push_error(err,code,0,__FILE__,__LINE__,fmt,arg); } while(0) 114 #define OPS_MEMORY_ERROR(err) {fprintf(stderr, "Memory error\n");} // \todo placeholder for better error handling 114 115 #define OPS_ERROR(err,code,fmt) do { ops_push_error(err,code,0,__FILE__,__LINE__,fmt); } while(0) 115 116 #define OPS_ERROR_1(err,code,fmt,arg) do { ops_push_error(err,code,0,__FILE__,__LINE__,fmt,arg); } while(0) openpgpsdk/trunk/include/openpgpsdk/signature.h
r570 r573 78 78 size_t length); 79 79 ops_hash_t *ops_signature_get_hash(ops_create_signature_t *sig); 80 voidops_signature_hashed_subpackets_end(ops_create_signature_t *sig);81 voidops_write_signature(ops_create_signature_t *sig,const ops_public_key_t *key,80 ops_boolean_t ops_signature_hashed_subpackets_end(ops_create_signature_t *sig); 81 ops_boolean_t ops_write_signature(ops_create_signature_t *sig,const ops_public_key_t *key, 82 82 const ops_secret_key_t *skey, ops_create_info_t *opt); 83 voidops_signature_add_creation_time(ops_create_signature_t *sig,time_t when);84 voidops_signature_add_issuer_key_id(ops_create_signature_t *sig,83 ops_boolean_t ops_signature_add_creation_time(ops_create_signature_t *sig,time_t when); 84 ops_boolean_t ops_signature_add_issuer_key_id(ops_create_signature_t *sig, 85 85 const unsigned char keyid[OPS_KEY_ID_SIZE]); 86 86 void ops_signature_add_primary_user_id(ops_create_signature_t *sig, … … 88 88 89 89 // Standard Interface 90 voidops_sign_file_as_cleartext(const char* filename, const ops_secret_key_t *skey, const ops_boolean_t overwrite);91 voidops_sign_buf_as_cleartext(const char* input, const size_t len, ops_memory_t** output, const ops_secret_key_t *skey);90 ops_boolean_t ops_sign_file_as_cleartext(const char* filename, const ops_secret_key_t *skey, const ops_boolean_t overwrite); 91 ops_boolean_t ops_sign_buf_as_cleartext(const char* input, const size_t len, ops_memory_t** output, const ops_secret_key_t *skey); 92 92 void ops_sign_file(const char* input_filename, const char* output_filename, const ops_secret_key_t *skey, const ops_boolean_t use_armour, const ops_boolean_t overwrite); 93 93 ops_memory_t * ops_sign_mem(const void* input, const int input_len, const ops_sig_type_t sig_type, const ops_secret_key_t *skey, const ops_boolean_t use_armour); openpgpsdk/trunk/src/lib/adv_armour.c
r571 r573 29 29 #include <openpgpsdk/crypto.h> 30 30 #include <openpgpsdk/create.h> 31 #include <openpgpsdk/readerwriter.h> 31 32 #include <openpgpsdk/signature.h> 32 33 #include <openpgpsdk/version.h> … … 909 910 } 910 911 911 // XXX: should return errors.912 912 /** 913 913 * \param info 914 914 * \param sig 915 * \todo should return errors916 915 */ 917 voidops_writer_push_clearsigned(ops_create_info_t *info,916 ops_boolean_t ops_writer_push_clearsigned(ops_create_info_t *info, 918 917 ops_create_signature_t *sig) 919 918 { … … 922 921 dash_escaped_arg_t *arg=ops_mallocz(sizeof *arg); 923 922 924 ops_write(header,sizeof header-1,info); 925 ops_write(hash,strlen(hash),info); 926 ops_write("\r\n\r\n",4,info); 923 ops_boolean_t rtn; 924 925 rtn= ( ops_write(header,sizeof header-1,info) 926 && ops_write(hash,strlen(hash),info) 927 && ops_write("\r\n\r\n",4,info)); 928 929 if (rtn==ops_false) 930 { 931 OPS_ERROR(&info->errors, OPS_E_W, "Error pushing clearsigned header"); 932 return rtn; 933 } 934 927 935 arg->seen_nl=ops_true; 928 936 arg->sig=sig; 929 937 arg->trailing=ops_memory_new(); 930 938 ops_writer_push(info,dash_escaped_writer,NULL,dash_escaped_destroyer,arg); 939 return rtn; 931 940 } 932 941 … … 1062 1071 } 1063 1072 1064 // XXX: should return errors.1065 1073 /** 1066 1074 * \param info 1067 1075 */ 1068 voidops_writer_switch_to_armoured_signature(ops_create_info_t *info)1076 ops_boolean_t ops_writer_switch_to_armoured_signature(ops_create_info_t *info) 1069 1077 { 1070 1078 static char header[]="\r\n-----BEGIN PGP SIGNATURE-----\r\nVersion: " … … 1073 1081 1074 1082 ops_writer_pop(info); 1075 ops_write(header,sizeof header-1,info); 1083 if (ops_write(header,sizeof header-1,info)==ops_false) 1084 { 1085 OPS_ERROR(&info->errors, OPS_E_W, "Error switching to armoured signature"); 1086 return ops_false; 1087 } 1076 1088 1077 1089 ops_writer_push(info,linebreak_writer,NULL,ops_writer_generic_destroyer, … … 1079 1091 1080 1092 base64=ops_mallocz(sizeof *base64); 1093 if (!base64) 1094 { 1095 OPS_MEMORY_ERROR(&info->errors); 1096 return ops_false; 1097 } 1081 1098 base64->checksum=CRC24_INIT; 1082 1099 ops_writer_push(info,base64_writer,signature_finaliser, 1083 1100 ops_writer_generic_destroyer,base64); 1101 return ops_true; 1084 1102 } 1085 1103 … … 1196 1214 } 1197 1215 1198 // XXX: should return errors.1199 /**1200 * \param info1201 * \todo should return errors1202 */1203 /*1204 void ops_writer_push_armoured_public_key(ops_create_info_t *info)1205 {1206 static char header[]="-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nVersion: "1207 OPS_VERSION_STRING "\r\n\r\n";1208 base64_arg_t *arg=ops_mallocz(sizeof *arg);1209 1210 ops_write(header,sizeof header-1,info);1211 1212 arg->checksum=CRC24_INIT;1213 ops_writer_push(info,base64_writer,armoured_public_key_finaliser,ops_writer_generic_destroyer,arg);1214 }1215 */1216 1217 // XXX: should return errors.1218 /**1219 * \param info1220 * \todo should return errors1221 */1222 1216 // \todo use this for other armoured types 1223 1217 void ops_writer_push_armoured(ops_create_info_t *info, ops_armor_type_t type) openpgpsdk/trunk/src/lib/adv_create.c
r570 r573 100 100 * \param info 101 101 * \return 1 if OK, otherwise 0 102 * \todo This statement about the return value is true based on the assumption103 * that ops_true=1. Tidy this assumption up.104 102 */ 105 103 … … 161 159 * \param type 162 160 * \param info 163 * \return 1 if OK, otherwise 0161 * \return ops_true if OK, otherwise ops_false 164 162 */ 165 163 … … 197 195 * \param id 198 196 * \param info 199 * \return Return value from ops_write() unless call to ops_write_ptag() or ops_write_length() failed before it was called, in which case returns 0 200 * \todo tidy up that return value description! 197 * \return ops_true if OK, otherwise ops_false 201 198 */ 202 199 ops_boolean_t ops_write_struct_user_id(ops_user_id_t *id, … … 669 666 * \param info 670 667 * \return Return value from write_public_key_body() unless call to ops_write_ptag() or ops_write_length() failed before it was called, in which case returns 0 671 * \ todo tidy up that return value description!668 * \return ops_true if OK, otherwise ops_false 672 669 */ 673 670 ops_boolean_t ops_write_struct_public_key(const ops_public_key_t *key, … … 698 695 * \param info Writer setup 699 696 * 700 * \return result from ops_write_struct_public_key() 701 * 702 * \todo get better definition of return values 697 * \return ops_true if OK, otherwise ops_false 703 698 */ 704 699 … … 1321 1316 ops_create_info_t *info) 1322 1317 { 1323 // \todo add filename 1324 // \todo add date 1318 /* 1319 * RFC4880 does not specify a meaning for filename or date. 1320 * It is implementation-dependent. 1321 * We will not implement them. 1322 */ 1325 1323 // \todo do we need to check text data for <cr><lf> line endings ? 1326 1324 return ops_write_ptag(OPS_PTAG_CT_LITERAL_DATA, info) … … 1362 1360 } 1363 1361 close(fd); 1364 // \todo add date 1362 1365 1363 // \todo do we need to check text data for <cr><lf> line endings ? 1366 1364 len=ops_memory_get_length(mem); openpgpsdk/trunk/src/lib/adv_fingerprint.c
r570 r573 116 116 * \param keyid Space for the calculated ID to be stored 117 117 * \param key The key for which the ID is calculated 118 * \todo add error return value 118 119 */ 119 120 openpgpsdk/trunk/src/lib/adv_openssl_crypto.c
r571 r573 322 322 323 323 skey->public_key.version=4; 324 //\todo skey->public_key.creation_time=NULL; // \todo324 skey->public_key.creation_time=time(NULL); 325 325 skey->public_key.days_valid=0; 326 326 skey->public_key.algorithm= OPS_PKA_RSA; openpgpsdk/trunk/src/lib/adv_signature.c
r571 r573 24 24 25 25 #include <openpgpsdk/signature.h> 26 #include <openpgpsdk/readerwriter.h> 26 27 #include <openpgpsdk/crypto.h> 27 28 #include <openpgpsdk/create.h> … … 635 636 */ 636 637 637 voidops_signature_hashed_subpackets_end(ops_create_signature_t *sig)638 ops_boolean_t ops_signature_hashed_subpackets_end(ops_create_signature_t *sig) 638 639 { 639 640 sig->hashed_data_length=ops_memory_get_length(sig->mem) … … 643 644 // dummy unhashed subpacket count 644 645 sig->unhashed_count_offset=ops_memory_get_length(sig->mem); 645 ops_write_scalar(0,2,sig->info);646 return ops_write_scalar(0,2,sig->info); 646 647 } 647 648 … … 659 660 */ 660 661 661 voidops_write_signature(ops_create_signature_t *sig, const ops_public_key_t *key,662 ops_boolean_t ops_write_signature(ops_create_signature_t *sig, const ops_public_key_t *key, 662 663 const ops_secret_key_t *skey, ops_create_info_t *info) 663 664 { 665 ops_boolean_t rtn=ops_false; 664 666 size_t l=ops_memory_get_length(sig->mem); 665 667 … … 693 695 rsa_sign(&sig->hash,&key->key.rsa,&skey->key.rsa,sig->info); 694 696 695 ops_write_ptag(OPS_PTAG_CT_SIGNATURE,info); 696 l=ops_memory_get_length(sig->mem); 697 ops_write_length(l,info); 698 ops_write(ops_memory_get_data(sig->mem),l,info); 697 rtn=ops_write_ptag(OPS_PTAG_CT_SIGNATURE,info); 698 if (rtn!=ops_false) 699 { 700 l=ops_memory_get_length(sig->mem); 701 rtn = ops_write_length(l,info) 702 && ops_write(ops_memory_get_data(sig->mem),l,info); 703 } 699 704 700 705 ops_memory_free(sig->mem); 706 707 if (rtn==ops_false) 708 { 709 OPS_ERROR(&info->errors,OPS_E_W,"Cannot write signature"); 710 } 711 return rtn; 701 712 } 702 713 … … 709 720 * \param when 710 721 */ 711 voidops_signature_add_creation_time(ops_create_signature_t *sig,time_t when)712 { 713 ops_write_ss_header(5,OPS_PTAG_SS_CREATION_TIME,sig->info);714 ops_write_scalar(when,4,sig->info);722 ops_boolean_t ops_signature_add_creation_time(ops_create_signature_t *sig,time_t when) 723 { 724 return ops_write_ss_header(5,OPS_PTAG_SS_CREATION_TIME,sig->info) 725 && ops_write_scalar(when,4,sig->info); 715 726 } 716 727 … … 724 735 */ 725 736 726 voidops_signature_add_issuer_key_id(ops_create_signature_t *sig,737 ops_boolean_t ops_signature_add_issuer_key_id(ops_create_signature_t *sig, 727 738 const unsigned char keyid[OPS_KEY_ID_SIZE]) 728 739 { 729 ops_write_ss_header(OPS_KEY_ID_SIZE+1,OPS_PTAG_SS_ISSUER_KEY_ID,sig->info);730 ops_write(keyid,OPS_KEY_ID_SIZE,sig->info);740 return ops_write_ss_header(OPS_KEY_ID_SIZE+1,OPS_PTAG_SS_ISSUER_KEY_ID,sig->info) 741 && ops_write(keyid,OPS_KEY_ID_SIZE,sig->info); 731 742 } 732 743 openpgpsdk/trunk/src/lib/std_signature.c
r570 r573 40 40 #define MAXBUF 1024 41 41 42 voidops_sign_file_as_cleartext(const char* filename, const ops_secret_key_t *skey, const ops_boolean_t overwrite)42 ops_boolean_t ops_sign_file_as_cleartext(const char* filename, const ops_secret_key_t *skey, const ops_boolean_t overwrite) 43 43 { 44 44 // \todo allow choice of hash algorithams … … 55 55 unsigned char buf[MAXBUF]; 56 56 //int flags=0; 57 ops_boolean_t rtn=ops_false; 57 58 58 59 // open file to sign … … 64 65 if(fd_in < 0) 65 66 { 66 perror(filename); 67 exit(2); 67 return ops_false; 68 68 } 69 69 … … 71 71 snprintf(signed_file,sizeof signed_file,"%s.%s",filename,suffix); 72 72 fd_out=ops_setup_file_write(&cinfo, signed_file, overwrite); 73 if (fd_out < 0) 74 { 75 close (fd_in); 76 return ops_false; 77 } 73 78 74 79 // set up signature 75 80 sig=ops_create_signature_new(); 81 if (!sig) 82 { 83 close (fd_in); 84 ops_teardown_file_write(cinfo,fd_out); 85 return ops_false; 86 } 87 88 // \todo could add more error detection here 76 89 ops_signature_start_cleartext_signature(sig,skey,OPS_HASH_SHA1,OPS_SIG_BINARY); 77 ops_writer_push_clearsigned(cinfo,sig); 90 if (ops_writer_push_clearsigned(cinfo,sig)!=ops_true) 91 { return ops_false; } 78 92 79 93 // Do the signing … … 94 108 // - creation time 95 109 // - key id 96 ops_writer_switch_to_armoured_signature(cinfo); 97 98 // \todo creation time 99 ops_signature_add_creation_time(sig,time(NULL)); 110 rtn = ops_writer_switch_to_armoured_signature(cinfo) 111 && ops_signature_add_creation_time(sig,time(NULL)); 112 if (rtn==ops_false) 113 { 114 ops_teardown_file_write(cinfo,fd_out); 115 return ops_false; 116 } 117 100 118 ops_keyid(keyid,&skey->public_key); 101 ops_signature_add_issuer_key_id(sig,keyid); 102 ops_signature_hashed_subpackets_end(sig);103 104 ops_write_signature(sig,&skey->public_key,skey,cinfo);119 120 rtn = ops_signature_add_issuer_key_id(sig,keyid) 121 && ops_signature_hashed_subpackets_end(sig) 122 && ops_write_signature(sig,&skey->public_key,skey,cinfo); 105 123 106 124 ops_teardown_file_write(cinfo,fd_out); 125 126 if (rtn==ops_false) 127 { 128 OPS_ERROR(&cinfo->errors,OPS_E_W,"Cannot sign file as cleartext"); 129 } 130 return rtn; 107 131 } 108 132 … … 110 134 /* It is the calling function's responsibility to free signed_cleartext */ 111 135 /* signed_cleartext should be a NULL pointer when passed in */ 112 voidops_sign_buf_as_cleartext(const char* cleartext, const size_t len, ops_memory_t** signed_cleartext, const ops_secret_key_t *skey)136 ops_boolean_t ops_sign_buf_as_cleartext(const char* cleartext, const size_t len, ops_memory_t** signed_cleartext, const ops_secret_key_t *skey) 113 137 { 138 ops_boolean_t rtn=ops_false; 139 114 140 // \todo allow choice of hash algorithams 115 141 // enforce use of SHA1 for now … … 124 150 // set up signature 125 151 sig=ops_create_signature_new(); 152 if (!sig) 153 { 154 return ops_false; 155 } 156 157 // \todo could add more error detection here 126 158 ops_signature_start_cleartext_signature(sig,skey,OPS_HASH_SHA1,OPS_SIG_BINARY); 127 159 … … 129 161 ops_setup_memory_write(&cinfo, signed_cleartext, len); 130 162 131 ops_writer_push_clearsigned(cinfo,sig);132 133 163 // Do the signing 134 135 ops_write(cleartext,len,cinfo);136 137 164 // add signature with subpackets: 138 165 // - creation time 139 166 // - key id 140 ops_writer_switch_to_armoured_signature(cinfo); 141 142 ops_signature_add_creation_time(sig,time(NULL)); 167 rtn = ops_writer_push_clearsigned(cinfo,sig) 168 && ops_write(cleartext,len,cinfo) 169 && ops_writer_switch_to_armoured_signature(cinfo) 170 && ops_signature_add_creation_time(sig,time(NULL)); 171 172 if (rtn==ops_false) 173 { 174 return ops_false; 175 } 176 143 177 ops_keyid(keyid,&skey->public_key); 144 ops_signature_add_issuer_key_id(sig,keyid); 145 ops_signature_hashed_subpackets_end(sig);146 147 ops_write_signature(sig,&skey->public_key,skey,cinfo);148 149 // the calling function must free signed_cleartext 150 ops_writer_close(cinfo);178 179 rtn = ops_signature_add_issuer_key_id(sig,keyid) 180 && ops_signature_hashed_subpackets_end(sig) 181 && ops_write_signature(sig,&skey->public_key,skey,cinfo) 182 && ops_writer_close(cinfo); 183 184 // Note: the calling function must free signed_cleartext 151 185 ops_create_info_delete(cinfo); 186 187 return rtn; 152 188 } 153 189 … … 296 332 // - key id 297 333 298 // \todo add creation time299 334 ops_signature_add_creation_time(sig,time(NULL)); 300 335 openpgpsdk/trunk/tests/test_rsa_decrypt.c
r572 r573 265 265 // 266 266 267 /* 267 268 static void test_todo(void) 268 269 { 269 CU_FAIL("Test TODO: Decryption with multiple keys in same keyring"); 270 CU_FAIL("Test TODO: Decryption with multiple keys where some are not in my keyring"); 271 CU_FAIL("Test TODO: Decryption with multiple keys where my key is (a) first key in list; (b) last key in list; (c) in the middle of the list"); 272 } 270 CU_FAIL("Test FUTURE: Decryption with multiple keys in same keyring"); 271 CU_FAIL("Test FUTURE: Decryption with multiple keys where some are not in my keyring"); 272 CU_FAIL("Test FUTURE: Decryption with multiple keys where my key is (a) first key in list; (b) last key in list; (c) in the middle of the list"); 273 } 274 */ 273 275 274 276 static int add_tests(CU_pSuite suite) … … 288 290 return 0; 289 291 292 /* 290 293 if (NULL == CU_add_test(suite, "Tests to be implemented", test_todo)) 291 294 return 0; 292 295 */ 293 296 return 1; 294 297 } openpgpsdk/trunk/tests/test_rsa_encrypt.c
r572 r573 257 257 CU_FAIL("Test TODO: Encrypt to multiple keys where my keys is (a) first key in list; (b) last key in list; (c) in the middle of the list"); 258 258 CU_FAIL("Test TODO: Encrypt to users with different preferences"); 259 CU_FAIL("Test TODO: Test large files");260 259 */ 261 260 } openpgpsdk/trunk/tests/test_rsa_keys.c
r572 r573 331 331 static void test_rsa_keys_todo(void) 332 332 { 333 /* 334 * Key expiry and revocation checking can be done at the 335 * application level by checking the set of valid keys returned. 336 */ 337 333 338 // expired 334 CU_FAIL("Test TODO: Check for key expiry");339 //CU_FAIL("Test TODO: Check for key expiry"); 335 340 336 341 // revoked 337 CU_FAIL("Test TODO: Check for key revocation");342 //CU_FAIL("Test TODO: Check for key revocation"); 338 343 } 339 344 openpgpsdk/trunk/tests/test_rsa_signature.c
r572 r573 40 40 static int debug=0; 41 41 42 static char *filename_rsa_large_noarmour_nopassphrase="ops_rsa_signed_large_noarmour_nopassphrase.txt"; 43 static char *filename_rsa_large_armour_nopassphrase="ops_rsa_signed_large_armour_nopassphrase.txt"; 42 44 static char *filename_rsa_noarmour_nopassphrase="ops_rsa_signed_noarmour_nopassphrase.txt"; 43 45 static char *filename_rsa_noarmour_passphrase="ops_rsa_signed_noarmour_passphrase.txt"; … … 67 69 create_small_testfile(filename_rsa_clearsign_buf_passphrase); 68 70 71 create_large_testfile(filename_rsa_large_noarmour_nopassphrase); 72 create_large_testfile(filename_rsa_large_armour_nopassphrase); 73 69 74 // Return success 70 75 return 0; … … 415 420 } 416 421 422 static void test_rsa_signature_large_noarmour_nopassphrase(void) 423 { 424 int armour=0; 425 assert(pub_keyring.nkeys); 426 test_rsa_signature_sign(armour,filename_rsa_large_noarmour_nopassphrase, alpha_skey); 427 } 428 429 static void test_rsa_signature_large_armour_nopassphrase(void) 430 { 431 int armour=1; 432 assert(pub_keyring.nkeys); 433 test_rsa_signature_sign(armour,filename_rsa_large_armour_nopassphrase, alpha_skey); 434 } 435 417 436 static void test_rsa_signature_noarmour_nopassphrase(void) 418 437 { … … 483 502 } 484 503 504 /* 485 505 static void test_todo(void) 486 506 { 487 CU_FAIL("Test TODO: Test large files"); 488 CU_FAIL("Test TODO: Sign with V3 signature?"); 489 CU_FAIL("Test TODO: Use other hash algorithms?"); 490 CU_FAIL("Test TODO: Check for key/signature expiry"); 491 CU_FAIL("Test TODO: Check for key/signature revocation"); 492 } 507 CU_FAIL("Test FUTURE: Use other hash algorithms"); 508 CU_FAIL("Test FUTURE: Check for key expiry"); 509 CU_FAIL("Test FUTURE: Check for key revocation"); 510 CU_FAIL("Test FUTURE: Check for signature expiry"); 511 CU_FAIL("Test FUTURE: Check for signature revocation"); 512 } 513 */ 493 514 494 515 static int add_tests(CU_pSuite suite) … … 520 541 return 0; 521 542 543 if (NULL == CU_add_test(suite, "Large, no armour, no passphrase", test_rsa_signature_large_noarmour_nopassphrase)) 544 return 0; 545 546 if (NULL == CU_add_test(suite, "Large, armour, no passphrase", test_rsa_signature_large_armour_nopassphrase)) 547 return 0; 548 549 /* 522 550 if (NULL == CU_add_test(suite, "Tests to be implemented", test_todo)) 523 551 return 0; 524 552 */ 525 553 return 1; 526 554 } openpgpsdk/trunk/tests/tests.c
r571 r573 46 46 } 47 47 48 //#ifdef XXX 48 49 if (NULL == suite_crypto()) 49 50 { … … 72 73 return CU_get_error(); 73 74 } 75 //#endif 74 76 75 77 if (NULL == suite_rsa_signature()) … … 79 81 return CU_get_error(); 80 82 } 81 83 //#ifdef XXX 82 84 if (NULL == suite_rsa_verify()) 83 85 { … … 100 102 return CU_get_error(); 101 103 } 104 //#endif 102 105 103 106 // Run tests
