rv = DecryptSigBlock(&hashid, &cx->u.rsadigest[0], sizeof cx->u.rsadigest, cx->key, sig, (char*)cx->wincx);
rv = DecryptSigBlock(&hashid, cx->u.buffer, HASH_LENGTH_MAX, cx->key, sig, (char*)cx->wincx);
VFY_EndWithSignature(VFYContext *cx, SECItem *sig){    unsigned char final[HASH_LENGTH_MAX];    unsigned part;    SECItem hash,dsasig; /* dsasig is also used for ECDSA */    SECStatus rv;    if ((cx->hasSignature == PR_FALSE) && (sig == NULL)) {	PORT_SetError(SEC_ERROR_INVALID_ARGS);	return SECFailure;    }    if (cx->hashcx == NULL) {	PORT_SetError(SEC_ERROR_INVALID_ARGS);	return SECFailure;    }    (*cx->hashobj->end)(cx->hashcx, final, &part, sizeof(final));    switch (cx->type) {      case VFY_DSA:      case VFY_ECDSA:	if (cx->type == VFY_DSA) {	    dsasig.data = cx->u.dsasig;	    dsasig.len = DSA_SIGNATURE_LEN;	} else {	    dsasig.data = cx->u.ecdsasig;	    dsasig.len = SECKEY_PublicKeyStrength(cx->key) * 2;	}	if (sig) {	    rv = decodeECorDSASignature(cx->sigAlg,sig,dsasig.data,					dsasig.len);	    if (rv != SECSuccess) {		PORT_SetError(SEC_ERROR_BAD_SIGNATURE);		return SECFailure;	    }	} 	hash.data = final;	hash.len = part;	if (PK11_Verify(cx->key,&dsasig,&hash,cx->wincx) != SECSuccess) {		PORT_SetError(SEC_ERROR_BAD_SIGNATURE);		return SECFailure;	}	break;      case VFY_RSA:	if (sig) {	    SECOidTag hashid = SEC_OID_UNKNOWN;	    rv = DecryptSigBlock(&hashid, &cx->u.rsadigest[0], 		    sizeof cx->u.rsadigest, cx->key, sig, (char*)cx->wincx);	    if ((rv != SECSuccess) || (hashid != cx->alg)) {		PORT_SetError(SEC_ERROR_BAD_SIGNATURE);		return SECFailure;	    }	}	if (PORT_Memcmp(final, cx->u.rsadigest, part)) {	    PORT_SetError(SEC_ERROR_BAD_SIGNATURE);	    return SECFailure;	}	break;      default:	PORT_SetError(SEC_ERROR_BAD_SIGNATURE);	return SECFailure; /* shouldn't happen */    }    return SECSuccess;}