aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src/crypto.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-08-29 21:59:21 +0200
committerSverker Eriksson <[email protected]>2012-08-29 21:59:21 +0200
commit2d5d3b964942ab75777d2192fb15668e0f86456d (patch)
treed20f3eea10a8d420158877b85610543cd9e697dd /lib/crypto/c_src/crypto.c
parent46820dc1ce466d383e464cb5ffb8cec676039f8b (diff)
downloadotp-2d5d3b964942ab75777d2192fb15668e0f86456d.tar.gz
otp-2d5d3b964942ab75777d2192fb15668e0f86456d.tar.bz2
otp-2d5d3b964942ab75777d2192fb15668e0f86456d.zip
crypto: Fix buffer overflow bug in rsa_sign
Diffstat (limited to 'lib/crypto/c_src/crypto.c')
-rw-r--r--lib/crypto/c_src/crypto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index a24747a872..91ab244620 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -1875,7 +1875,7 @@ static int get_rsa_private_key(ErlNifEnv* env, ERL_NIF_TERM key, RSA *rsa)
static ERL_NIF_TERM rsa_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (Type, Data|{digest,Digest}, Key=[E,N,D]|[E,N,D,P1,P2,E1,E2,C]) */
ErlNifBinary data_bin, ret_bin;
- unsigned char hmacbuf[SHA_DIGEST_LENGTH];
+ unsigned char hmacbuf[SHA512_LEN];
unsigned rsa_s_len;
RSA* rsa;
int i;