]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix buffer overflow
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 31 Mar 2011 20:20:48 +0000 (13:20 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 31 Mar 2011 20:22:31 +0000 (13:22 -0700)
Remove unecessary code that was causing a buffer overflow.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/rgw/rgw_common.cc

index d7dacc22c98bcf7783398a8aa423f16f57da998d..a9c14543560aed3b676f135644a8fbdf4b9bb224 100644 (file)
@@ -29,10 +29,6 @@ void calc_hmac_sha1(const char *key, int key_len,
                     const char *msg, int msg_len, char *dest)
 /* destination should be CEPH_CRYPTO_HMACSHA1_DIGESTSIZE bytes long */
 {
-  char key_buf[CEPH_CRYPTO_HMACSHA1_DIGESTSIZE];
-  memset(key_buf, 0, CEPH_CRYPTO_HMACSHA1_DIGESTSIZE);
-  memcpy(key_buf, key, key_len);
-
   HMACSHA1 hmac((const unsigned char *)key, key_len);
   hmac.Update((const unsigned char *)msg, msg_len);
   hmac.Final((unsigned char *)dest);