Changeset 566
- Timestamp:
- 06/30/08 14:00:12
- Files:
-
- openpgpsdk/trunk/include/openpgpsdk/std_print.h (modified) (1 diff)
- openpgpsdk/trunk/src/lib/adv_create.c (modified) (1 diff)
- openpgpsdk/trunk/src/lib/adv_packet-parse.c (modified) (2 diffs)
- openpgpsdk/trunk/src/lib/std_print.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/include/openpgpsdk/std_print.h
r558 r566 16 16 17 17 void ops_print_public_keydata_verbose(const ops_keydata_t *key); 18 void ops_print_public_key _t(const ops_public_key_t *pkey);18 void ops_print_public_key(const ops_public_key_t *pkey); 19 19 20 20 void ops_print_secret_keydata(const ops_keydata_t *key); 21 21 void ops_print_secret_keydata_verbose(const ops_keydata_t *key); 22 void ops_print_secret_key(const ops_content_tag_t type, const ops_secret_key_t* skey);22 //void ops_print_secret_key(const ops_content_tag_t type, const ops_secret_key_t* skey); 23 23 int ops_print_packet(const ops_parser_content_t *content_); 24 24 #endif openpgpsdk/trunk/src/lib/adv_create.c
r563 r566 493 493 fprintf(stderr,"\n"); 494 494 495 ops_print_secret_key(OPS_PTAG_CT_SECRET_KEY,key);495 //ops_print_secret_key(OPS_PTAG_CT_SECRET_KEY,key); 496 496 497 497 fprintf(stderr,"turning encryption on...\n"); openpgpsdk/trunk/src/lib/adv_packet-parse.c
r565 r566 2017 2017 { 2018 2018 fprintf(stderr,"parse_secret_key: public key parsed\n"); 2019 ops_print_public_key _t(&C.secret_key.public_key);2019 ops_print_public_key(&C.secret_key.public_key); 2020 2020 } 2021 2021 … … 2244 2244 { 2245 2245 fprintf(stderr,"4 MPIs read\n"); 2246 ops_print_secret_key(OPS_PTAG_CT_SECRET_KEY, &C.secret_key);2246 // ops_print_secret_key_verbose(OPS_PTAG_CT_SECRET_KEY, &C.secret_key); 2247 2247 } 2248 2248 openpgpsdk/trunk/src/lib/std_print.c
r558 r566 87 87 88 88 void 89 ops_print_public_key _t(const ops_public_key_t *pkey)89 ops_print_public_key(const ops_public_key_t *pkey) 90 90 { 91 91 printf("------- PUBLIC KEY ------\n"); … … 141 141 const ops_public_key_t* pkey=&key->key.pkey; 142 142 143 ops_print_public_key_t(pkey); 144 /* 145 print_unsigned_int("Version",pkey->version); 146 print_time("Creation Time", pkey->creation_time); 147 if(pkey->version == OPS_V3) 148 print_unsigned_int("Days Valid",pkey->days_valid); 149 150 print_string_and_value("Algorithm",ops_show_pka(pkey->algorithm), 151 pkey->algorithm); 152 153 switch(pkey->algorithm) 154 { 155 case OPS_PKA_DSA: 156 print_bn("p",pkey->key.dsa.p); 157 print_bn("q",pkey->key.dsa.q); 158 print_bn("g",pkey->key.dsa.g); 159 print_bn("y",pkey->key.dsa.y); 160 break; 161 162 case OPS_PKA_RSA: 163 case OPS_PKA_RSA_ENCRYPT_ONLY: 164 case OPS_PKA_RSA_SIGN_ONLY: 165 print_bn("n",pkey->key.rsa.n); 166 print_bn("e",pkey->key.rsa.e); 167 break; 168 169 case OPS_PKA_ELGAMAL: 170 case OPS_PKA_ELGAMAL_ENCRYPT_OR_SIGN: 171 print_bn("p",pkey->key.elgamal.p); 172 print_bn("g",pkey->key.elgamal.g); 173 print_bn("y",pkey->key.elgamal.y); 174 break; 175 176 default: 177 assert(0); 178 } 179 */ 143 ops_print_public_key(pkey); 180 144 } 181 145 … … 188 152 */ 189 153 154 void 155 ops_print_secret_keydata(const ops_keydata_t *key) 156 { 157 printf("sec "); 158 ops_show_pka(key->key.pkey.algorithm); 159 printf(" "); 160 161 hexdump(key->key_id, OPS_KEY_ID_SIZE); 162 printf(" "); 163 164 print_time_short(key->key.pkey.creation_time); 165 printf(" "); 166 167 if (key->nuids==1) 168 { 169 // print on same line as other info 170 printf ("%s\n", key->uids[0].user_id); 171 } 172 else 173 { 174 // print all uids on separate line 175 unsigned int i; 176 printf("\n"); 177 for (i=0; i<key->nuids; i++) 178 { 179 printf("uid %s\n",key->uids[i].user_id); 180 } 181 } 182 } 183 184 /* 190 185 void 191 ops_print_secret_keydata(const ops_keydata_t* key) 192 { 193 const ops_secret_key_t* skey=&key->key.skey; 186 ops_print_secret_key_verbose(const ops_secret_key_t* skey) 187 { 194 188 if(key->type == OPS_PTAG_CT_SECRET_KEY) 195 189 print_tagname("SECRET_KEY"); 196 190 else 197 191 print_tagname("ENCRYPTED_SECRET_KEY"); 198 ops_print_public_keydata(key);199 192 ops_print_secret_key(key->type,skey); 200 193 } 194 */ 201 195 202 196 void 203 ops_print_secret_key (const ops_content_tag_t type, const ops_secret_key_t* skey)197 ops_print_secret_key_verbose(const ops_content_tag_t type, const ops_secret_key_t* skey) 204 198 { 205 199 printf("------- SECRET KEY or ENCRYPTED SECRET KEY ------\n"); … … 251 245 252 246 printf("------- end of SECRET KEY or ENCRYPTED SECRET KEY ------\n"); 247 } 248 249 void 250 ops_print_secret_keydata_verbose(const ops_keydata_t *key) 251 { 252 const ops_secret_key_t* skey=&key->key.skey; 253 ops_print_public_keydata(key); 254 ops_print_secret_key_verbose(key->type,skey); 253 255 } 254 256
