Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

crypto: Fix buffer overflow bug in rsa_sign

  • Loading branch information...
commit 2d5d3b964942ab75777d2192fb15668e0f86456d 1 parent 46820dc
Sverker Eriksson authored August 29, 2012

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/crypto/c_src/crypto.c
2  lib/crypto/c_src/crypto.c
@@ -1875,7 +1875,7 @@ static int get_rsa_private_key(ErlNifEnv* env, ERL_NIF_TERM key, RSA *rsa)
1875 1875
 static ERL_NIF_TERM rsa_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
1876 1876
 {/* (Type, Data|{digest,Digest}, Key=[E,N,D]|[E,N,D,P1,P2,E1,E2,C]) */
1877 1877
     ErlNifBinary data_bin, ret_bin;
1878  
-    unsigned char hmacbuf[SHA_DIGEST_LENGTH];
  1878
+    unsigned char hmacbuf[SHA512_LEN];
1879 1879
     unsigned rsa_s_len;
1880 1880
     RSA* rsa;
1881 1881
     int i;

0 notes on commit 2d5d3b9

Please sign in to comment.
Something went wrong with that request. Please try again.