~ubuntu-branches/ubuntu/wily/rtmpdump/wily-proposed

« back to all changes in this revision

Viewing changes to librtmp/hashswf.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2014-04-11 22:08:17 UTC
  • mfrom: (6.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20140411220817-gef1vkyrygbyd87i
Tags: 2.4+20131018.git79459a2-2
Depends on libgmp-dev and nettle-dev to librtmpdev (Closes: #744242)

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
#define HMAC_finish(ctx, dig, dlen)     dlen = SHA256_DIGEST_LENGTH; sha2_hmac_finish(&ctx, dig)
43
43
#define HMAC_close(ctx)
44
44
#elif defined(USE_GNUTLS)
45
 
#include <gnutls/gnutls.h>
46
 
#include <gcrypt.h>
 
45
#include <nettle/hmac.h>
47
46
#ifndef SHA256_DIGEST_LENGTH
48
47
#define SHA256_DIGEST_LENGTH    32
49
48
#endif
50
 
#define HMAC_CTX        gcry_md_hd_t
51
 
#define HMAC_setup(ctx, key, len)       gcry_md_open(&ctx, GCRY_MD_SHA256, GCRY_MD_FLAG_HMAC); gcry_md_setkey(ctx, key, len)
52
 
#define HMAC_crunch(ctx, buf, len)      gcry_md_write(ctx, buf, len)
53
 
#define HMAC_finish(ctx, dig, dlen)     dlen = SHA256_DIGEST_LENGTH; memcpy(dig, gcry_md_read(ctx, 0), dlen)
54
 
#define HMAC_close(ctx) gcry_md_close(ctx)
 
49
#undef HMAC_CTX
 
50
#define HMAC_CTX        struct hmac_sha256_ctx
 
51
#define HMAC_setup(ctx, key, len)       hmac_sha256_set_key(&ctx, len, key)
 
52
#define HMAC_crunch(ctx, buf, len)      hmac_sha256_update(&ctx, len, buf)
 
53
#define HMAC_finish(ctx, dig, dlen)     dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig)
 
54
#define HMAC_close(ctx)
55
55
#else   /* USE_OPENSSL */
56
56
#include <openssl/ssl.h>
57
57
#include <openssl/sha.h>