summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa/dsa_sign.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_sign.c')
-rw-r--r--src/lib/libcrypto/dsa/dsa_sign.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_sign.c b/src/lib/libcrypto/dsa/dsa_sign.c
index 484e5f4357..40223a1d59 100644
--- a/src/lib/libcrypto/dsa/dsa_sign.c
+++ b/src/lib/libcrypto/dsa/dsa_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_sign.c,v 1.15 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: dsa_sign.c,v 1.16 2014/07/09 10:16:24 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -63,36 +63,39 @@
63#include <openssl/rand.h> 63#include <openssl/rand.h>
64#include <openssl/bn.h> 64#include <openssl/bn.h>
65 65
66DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) 66DSA_SIG *
67 { 67DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
68{
68 return dsa->meth->dsa_do_sign(dgst, dlen, dsa); 69 return dsa->meth->dsa_do_sign(dgst, dlen, dsa);
69 } 70}
70 71
71int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) 72int
72 { 73DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
74{
73 return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp); 75 return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
74 } 76}
75 77
76DSA_SIG *DSA_SIG_new(void) 78DSA_SIG *
77 { 79DSA_SIG_new(void)
80{
78 DSA_SIG *sig; 81 DSA_SIG *sig;
82
79 sig = malloc(sizeof(DSA_SIG)); 83 sig = malloc(sizeof(DSA_SIG));
80 if (!sig) 84 if (!sig)
81 return NULL; 85 return NULL;
82 sig->r = NULL; 86 sig->r = NULL;
83 sig->s = NULL; 87 sig->s = NULL;
84 return sig; 88 return sig;
85 } 89}
86 90
87void DSA_SIG_free(DSA_SIG *sig) 91void
88 { 92DSA_SIG_free(DSA_SIG *sig)
89 if (sig) 93{
90 { 94 if (sig) {
91 if (sig->r) 95 if (sig->r)
92 BN_free(sig->r); 96 BN_free(sig->r);
93 if (sig->s) 97 if (sig->s)
94 BN_free(sig->s); 98 BN_free(sig->s);
95 free(sig); 99 free(sig);
96 }
97 } 100 }
98 101}