sig.s.type = siUnsignedInteger;
DSAU_EncodeDerSig(SECItem *dest, SECItem *src){    SECItem *         item;    SECItem           srcItem;    DSA_ASN1Signature sig;    unsigned char     signedR[DSA_SUBPRIME_LEN + 1];    unsigned char     signedS[DSA_SUBPRIME_LEN + 1];    PORT_Memset(&sig, 0, sizeof(sig));    PORT_Assert(src->len == 2 * DSA_SUBPRIME_LEN);    if (src->len != 2 * DSA_SUBPRIME_LEN) {    	PORT_SetError( PR_INVALID_ARGUMENT_ERROR );	return SECFailure;    }    /* Must convert r and s from "unsigned" integers to "signed" integers.    ** If the high order bit of the first byte (MSB) is 1, then must    ** prepend with leading zero.      ** Must remove all but one leading zero byte from numbers.    */    sig.r.data = signedR;    sig.r.len  = sizeof signedR;    sig.s.data = signedS;    sig.s.len  = sizeof signedR;    srcItem.data = src->data;    srcItem.len  = DSA_SUBPRIME_LEN;    DSAU_ConvertUnsignedToSigned(&sig.r, &srcItem);    srcItem.data += DSA_SUBPRIME_LEN;    DSAU_ConvertUnsignedToSigned(&sig.s, &srcItem);    item = SEC_ASN1EncodeItem(NULL, dest, &sig, DSA_SignatureTemplate);    if (item == NULL)	return SECFailure;    /* XXX leak item? */    return SECSuccess;}