Implement DSA_SIG_set0() and ECDSA_SIG_set0(), for setting signature values.
[openssl.git] / crypto / dsa / dsa_asn1.c
index 93ce85f09e85d4d174f18a992724c7e402675217..b19bfaff509a2690d72144a7e0e550ce1671c323 100644 (file)
@@ -32,6 +32,15 @@ void DSA_SIG_get0(BIGNUM **pr, BIGNUM **ps, const DSA_SIG *sig)
     *ps = sig->s;
 }
 
+int DSA_SIG_set0(BIGNUM *r, BIGNUM *s, DSA_SIG *sig)
+{
+    BN_clear_free(sig->r);
+    BN_clear_free(sig->s);
+    sig->r = r;
+    sig->s = s;
+    return 1;
+}
+
 /* Override the default free and new methods */
 static int dsa_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
                   void *exarg)