rv = ((encrypt != PR_TRUE) ? DES_Decrypt : DES_Encrypt)(
rv = (encrypt ? DES_Encrypt : DES_Decrypt)(
sec_pkcs5_des(SECItem *key, SECItem *iv, SECItem *src, PRBool triple_des, 								PRBool encrypt){    SECItem *dest;    SECItem *dup_src;    SECStatus rv = SECFailure;    int pad;    if((src == NULL) || (key == NULL) || (iv == NULL))	return NULL;    dup_src = SECITEM_DupItem(src);    if(dup_src == NULL) {	return NULL;    }    if(encrypt != PR_FALSE) {	void *dummy;	dummy = DES_PadBuffer(NULL, dup_src->data, 	    dup_src->len, &dup_src->len);	if(dummy == NULL) {	    SECITEM_FreeItem(dup_src, PR_TRUE);	    return NULL;	}	dup_src->data = (unsigned char*)dummy;    }    dest = (SECItem *)PORT_ZAlloc(sizeof(SECItem));    if(dest != NULL) {	/* allocate with over flow */	dest->data = (unsigned char *)PORT_ZAlloc(dup_src->len + 64);	if(dest->data != NULL) {	    DESContext *ctxt;	    ctxt = DES_CreateContext(key->data, iv->data, 			(triple_des ? NSS_DES_EDE3_CBC : NSS_DES_CBC), 			encrypt);		    if(ctxt != NULL) {		rv = ((encrypt != PR_TRUE) ? DES_Decrypt : DES_Encrypt)(			ctxt, dest->data, &dest->len,			dup_src->len + 64, dup_src->data, dup_src->len);		/* remove padding -- assumes 64 bit blocks */		if((encrypt == PR_FALSE) && (rv == SECSuccess)) {		    pad = dest->data[dest->len-1];		    if((pad > 0) && (pad <= 8)) {			if(dest->data[dest->len-pad] != pad) {			    rv = SECFailure;			    PORT_SetError(SEC_ERROR_BAD_PASSWORD);			} else {			    dest->len -= pad;			}		    } else {			rv = SECFailure;			PORT_SetError(SEC_ERROR_BAD_PASSWORD);		    }		}		DES_DestroyContext(ctxt, PR_TRUE);	    }	}    }    if(rv == SECFailure) {	if(dest != NULL) {	    SECITEM_FreeItem(dest, PR_TRUE);	}	dest = NULL;    }    if(dup_src != NULL) {	SECITEM_FreeItem(dup_src, PR_TRUE);    }    return dest;}