PORT_Memcpy(digest, sig->data, sig->len);
PORT_Memcpy(dsig, sig->data, sig->len);
decodeECorDSASignature(SECOidTag algid, SECItem *sig, unsigned char *digest,		       unsigned int len) {    SECItem *dsasig = NULL; /* also used for ECDSA */    SECStatus rv=SECSuccess;    switch (algid) {    case SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST:    case SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST:    case SEC_OID_ANSIX9_DSA_SIGNATURE:    case SEC_OID_ANSIX962_ECDSA_SIGNATURE_WITH_SHA1_DIGEST:        if (algid == SEC_OID_ANSIX962_ECDSA_SIGNATURE_WITH_SHA1_DIGEST) {	    if (len > MAX_ECKEY_LEN * 2) {	        PORT_SetError(SEC_ERROR_BAD_DER);		return SECFailure;	    }	    dsasig = DSAU_DecodeDerSigToLen(sig, len);	} else {	    dsasig = DSAU_DecodeDerSig(sig);	}	if ((dsasig == NULL) || (dsasig->len != len)) {	    rv = SECFailure;	} else {	    PORT_Memcpy(digest, dsasig->data, dsasig->len);	}	break;    default:        if (sig->len != len) {	    rv = SECFailure;	} else {	    PORT_Memcpy(digest, sig->data, sig->len);	}	break;    }    if (dsasig != NULL) SECITEM_FreeItem(dsasig, PR_TRUE);    if (rv == SECFailure) PORT_SetError(SEC_ERROR_BAD_DER);    return rv;}