Changeset 562
- Timestamp:
- 05/22/08 15:49:15
- Files:
-
- openpgpsdk/trunk/tests/test_rsa_keys.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/tests/test_rsa_keys.c
r561 r562 83 83 int fd=0; 84 84 char *suffix = armoured ? "asc" : "ops"; 85 char cmd[MAXBUF+1]; 86 int rtn=0; 85 87 86 88 uid.user_id=(unsigned char *)"Test User 2<test2@nowhere.com>"; … … 100 102 ops_write_transferable_public_key(keydata,armoured,cinfo); 101 103 ops_teardown_file_write(cinfo,fd); 104 105 /* 106 * Validate public key with OPS 107 */ 102 108 103 109 // generate keyring from this file … … 115 121 ops_validate_result_free(result); 116 122 123 // Validate public key with GPG 124 125 snprintf(cmd, sizeof cmd, "%s --import --no-allow-non-selfsigned-uid %s", gpgcmd, filename); 126 rtn=system(cmd); 127 CU_ASSERT(rtn==0); 128 117 129 /* 118 130 * sec key … … 139 151 140 152 ops_validate_result_free(result); 153 154 // validate with GPG 155 snprintf(cmd, sizeof cmd, "%s --import --no-allow-non-selfsigned-uid %s", gpgcmd, filename); 156 rtn=system(cmd); 157 CU_ASSERT(rtn==0); 141 158 142 159 // cleanup … … 175 192 char* name2="Second<user2@nowhere.com>"; 176 193 uid2.user_id=(unsigned char *)name2; 194 char cmd[MAXBUF+1]; 195 int rtn=0; 177 196 178 197 /* … … 218 237 ops_keyring_read_from_file(&keyring3, armour, filename); 219 238 220 221 // sec key222 223 /*224 ops_setup_memory_write(&cinfo, &mem_seckey, 128);225 ops_write_struct_secret_key(seckey, cinfo);226 ops_create_info_delete(cinfo);227 */228 229 239 /* 230 240 * Test: Validate key against keyring without this key in it. … … 246 256 * Change signature on key to be incorrect. 247 257 * Then validate key against keyring with this key on it. 258 * Should fail as invalid. 248 259 */ 249 260 … … 259 270 ops_validate_result_free(result); 260 271 272 // validate with GPG - should fail 273 snprintf(cmd, sizeof cmd, "%s --import --no-allow-non-selfsigned-uid %s", gpgcmd, filename); 274 rtn=system(cmd); 275 CU_ASSERT(rtn!=0); 276 261 277 /* 262 278 * cleanup
