summaryrefslogtreecommitdiff
path: root/libavformat/rtmp.h
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2012-07-05 13:05:46 +0200
committerMartin Storsjö <martin@martin.st>2012-07-23 16:32:03 +0300
commit3505d5574e1d87ab8af9ea38337bfa0a1ca6381d (patch)
treeb6e55190a59ded26af79e6193163c1b45c17e132 /libavformat/rtmp.h
parent3b175384bb6491ecd44761e5282ae4c79567db57 (diff)
rtmp: Rename rtmp_calc_digest to ff_rtmp_calc_digest and make it global
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtmp.h')
-rw-r--r--libavformat/rtmp.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/libavformat/rtmp.h b/libavformat/rtmp.h
index f9d9900268..6a19f2e1e1 100644
--- a/libavformat/rtmp.h
+++ b/libavformat/rtmp.h
@@ -29,6 +29,9 @@
#define RTMP_HANDSHAKE_PACKET_SIZE 1536
+#define HMAC_IPAD_VAL 0x36
+#define HMAC_OPAD_VAL 0x5C
+
/**
* emulated Flash client version - 9.0.124.2 on Linux
* @{
@@ -40,4 +43,18 @@
#define RTMP_CLIENT_VER4 2
/** @} */ //version defines
+/**
+ * Calculate HMAC-SHA2 digest for RTMP handshake packets.
+ *
+ * @param src input buffer
+ * @param len input buffer length (should be 1536)
+ * @param gap offset in buffer where 32 bytes should not be taken into account
+ * when calculating digest (since it will be used to store that digest)
+ * @param key digest key
+ * @param keylen digest key length
+ * @param dst buffer where calculated digest will be stored (32 bytes)
+ */
+int ff_rtmp_calc_digest(const uint8_t *src, int len, int gap,
+ const uint8_t *key, int keylen, uint8_t *dst);
+
#endif /* AVFORMAT_RTMP_H */