int ECDSA_SIG_marshal(CBB *cbb, const ECDSA_SIG *sig) { CBB child; if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || !BN_bn2cbb(&child, sig->r) || !BN_bn2cbb(&child, sig->s) || !CBB_flush(cbb)) { OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_ENCODE_ERROR); return 0; } return 1; }
static int marshal_integer(CBB *cbb, BIGNUM *bn) { if (bn == NULL) { /* An RSA object may be missing some components. */ OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING); return 0; } return BN_bn2cbb(cbb, bn); }