Added comments and fix indentation

This commit is contained in:
Elio Maldonado 2008-10-11 19:45:12 +00:00
parent d33501a69b
commit dc25540c1c
1 changed files with 30 additions and 24 deletions

View File

@ -1438,6 +1438,10 @@ static int keyutil_main(
int rv; int rv;
if (cert_to_renew && input_key_file) { if (cert_to_renew && input_key_file) {
/*
* This certificate request is for a renewal,
* using existing keys.
*/
CK_SLOT_ID slotID = 1; CK_SLOT_ID slotID = 1;
char slotname[32]; char slotname[32];
char nickname[256]; char nickname[256];
@ -1484,7 +1488,10 @@ static int keyutil_main(
assert(subject); assert(subject);
} else { } else {
/*
* This a certificate request for a bran-new cert,
* will generate a key pair
*/
slot = PK11_GetInternalKeySlot(); /* PK11_GetInternalSlot() ? */ slot = PK11_GetInternalKeySlot(); /* PK11_GetInternalSlot() ? */
privkey = GenerateRSAPrivateKey(keytype, slot, privkey = GenerateRSAPrivateKey(keytype, slot,
@ -1504,7 +1511,6 @@ static int keyutil_main(
rv = 255; rv = 255;
goto shutdown; goto shutdown;
} }
} }
PR_fprintf(PR_STDOUT, "%s Got a key\n", progName); PR_fprintf(PR_STDOUT, "%s Got a key\n", progName);
@ -1654,7 +1660,7 @@ shutdown:
return rv == SECSuccess ? 0 : 255; return rv == SECSuccess ? 0 : 255;
} }
/* $Id: keyutil.c,v 1.4 2008/05/11 02:53:02 emaldonado Exp $ */ /* $Id: keyutil.c,v 1.5 2008/10/01 21:22:49 emaldonado Exp $ */
/* Key generation, encryption, and certificate utility code, based on /* Key generation, encryption, and certificate utility code, based on
* code from NSS's security utilities and the certutil application. * code from NSS's security utilities and the certutil application.