(EXTEN_VALUE_ENCODER)  CERT_EncodeCRLDistributionPoints);
(EXTEN_EXT_VALUE_ENCODER)  CERT_EncodeCRLDistributionPoints);
AddCrlDistPoint(void *extHandle){    PRArenaPool *arena = NULL;    CERTCrlDistributionPoints *crlDistPoints = NULL;    CRLDistributionPoint *current;    SECStatus rv = SECSuccess;    int count = 0, intValue;    char buffer[5];    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);    if ( !arena )	return (SECFailure);    do {	current = NULL;	current = PORT_ArenaZAlloc (arena, sizeof (*current));        if (current == NULL) {	    GEN_BREAK (SECFailure);	}   	/* Get the distributionPointName fields - this field is optional */	puts ("Enter the type of the distribution point name:\n");	puts ("\t1 - Full Name\n\t2 - Relative Name\n\tOther - omit\n\t\tChoice: ");	scanf ("%d", &intValue);	switch (intValue) {	    case generalName:		current->distPointType = intValue;		current->distPoint.fullName = GetGeneralName (arena);		rv = PORT_GetError();		break;			    case relativeDistinguishedName: {		CERTName *name;		char buffer[512];		current->distPointType = intValue;		puts ("Enter the relative name: ");		fflush (stdout);		gets (buffer);		/* For simplicity, use CERT_AsciiToName to converse from a string		   to NAME, but we only interest in the first RDN */		name = CERT_AsciiToName (buffer);		if (!name) {		    GEN_BREAK (SECFailure);		}		rv = CERT_CopyRDN (arena, &current->distPoint.relativeName, name->rdns[0]);		CERT_DestroyName (name);		break;	    }	}	if (rv != SECSuccess)	    break;	/* Get the reason flags */	puts ("\nSelect one of the following for the reason flags\n");	puts ("\t0 - unused\n\t1 - keyCompromise\n\t2 - caCompromise\n\t3 - affiliationChanged\n");	puts ("\t4 - superseded\n\t5 - cessationOfOperation\n\t6 - certificateHold\n");	puts ("\tother - omit\t\tChoice: ");		scanf ("%d", &intValue);	if (intValue >= 0 && intValue <8) {	    current->reasons.data = PORT_ArenaAlloc (arena, sizeof(char));	    if (current->reasons.data == NULL) {		GEN_BREAK (SECFailure);	    }	    *current->reasons.data = (char)(0x80 >> intValue);	    current->reasons.len = 1;	}	puts ("Enter value for the CRL Issuer name:\n");        current->crlIssuer = GetGeneralName (arena);	if (current->crlIssuer == NULL && (rv = PORT_GetError()) == SECFailure)	    break;	if (crlDistPoints == NULL) {	    crlDistPoints = PORT_ArenaZAlloc (arena, sizeof (*crlDistPoints));	    if (crlDistPoints == NULL) {		GEN_BREAK (SECFailure);	    }	}	    	crlDistPoints->distPoints = PORT_ArenaGrow (arena, 	     crlDistPoints->distPoints,	     sizeof (*crlDistPoints->distPoints) * count,	     sizeof (*crlDistPoints->distPoints) *(count + 1));	if (crlDistPoints->distPoints == NULL) {	    GEN_BREAK (SECFailure);	}		crlDistPoints->distPoints[count] = current;	++count;	if (GetYesNo ("Enter more value for the CRL distribution point extension [y/n]\n") == 0) {	    /* Add null to the end of the crlDistPoints to mark end of data */	    crlDistPoints->distPoints = PORT_ArenaGrow(arena, 		 crlDistPoints->distPoints,		 sizeof (*crlDistPoints->distPoints) * count,		 sizeof (*crlDistPoints->distPoints) *(count + 1));	    crlDistPoints->distPoints[count] = NULL;	    	    break;	}	    } while (1);        if (rv == SECSuccess) {	buffer[0] = 'n';	puts ("Is this a critical extension [y/n]? ");	gets (buffer);			rv = EncodeAndAddExtensionValue(arena, extHandle, crlDistPoints,	      (buffer[0] == 'Y' || buffer[0] == 'y') ? PR_TRUE : PR_FALSE,	      SEC_OID_X509_CRL_DIST_POINTS,	      (EXTEN_VALUE_ENCODER)  CERT_EncodeCRLDistributionPoints);    }    if (arena)	PORT_FreeArena (arena, PR_FALSE);    return (rv);}