From f76eb65d008d0c8e06698e4a63a776e91b80155b Mon Sep 17 00:00:00 2001
From: jfigus <foleyj@cisco.com>
Date: Tue, 4 Nov 2014 14:54:02 -0500
Subject: [PATCH] Rename SHA1 functions to avoid conflicts with downstream
Backported from upstream commit c270245a94ae9a007202754eb8f7ce9e48f97007
and tweaked to apply on top of v1.5.4.
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
crypto/hash/hmac.c | 20 ++++++++++----------
crypto/hash/hmac_ossl.c | 18 +++++++++---------
crypto/hash/sha1.c | 32 ++++++++++++++++----------------
crypto/include/hmac.h | 4 ++--
crypto/include/sha1.h | 34 +++++++++++++++++-----------------
crypto/test/sha1_driver.c | 8 ++++----
6 files changed, 58 insertions(+), 58 deletions(-)
diff --git a/crypto/hash/hmac.c b/crypto/hash/hmac.c
index ddb75ea..4bed61e 100644
@@ -141,11 +141,11 @@ hmac_init(hmac_ctx_t *state, const uint8_t *key, int key_len) {
debug_print(mod_hmac, "ipad: %s", octet_string_hex_string(ipad, 64));
/* initialize sha1 context */
- sha1_init(&state->init_ctx);
+ srtp_sha1_init(&state->init_ctx);
- sha1_update(&state->init_ctx, ipad, 64);
- memcpy(&state->ctx, &state->init_ctx, sizeof(sha1_ctx_t));
+ srtp_sha1_update(&state->init_ctx, ipad, 64);
+ memcpy(&state->ctx, &state->init_ctx, sizeof(srtp_sha1_ctx_t));
@@ -153,7 +153,7 @@ hmac_init(hmac_ctx_t *state, const uint8_t *key, int key_len) {
hmac_start(hmac_ctx_t *state) {
- memcpy(&state->ctx, &state->init_ctx, sizeof(sha1_ctx_t));
+ memcpy(&state->ctx, &state->init_ctx, sizeof(srtp_sha1_ctx_t));
@@ -165,7 +165,7 @@ hmac_update(hmac_ctx_t *state, const uint8_t *message, int msg_octets) {
octet_string_hex_string(message, msg_octets));
/* hash message into sha1 context */
- sha1_update(&state->ctx, message, msg_octets);
+ srtp_sha1_update(&state->ctx, message, msg_octets);
@@ -183,7 +183,7 @@ hmac_compute(hmac_ctx_t *state, const void *message,
/* hash message, copy output into H */
hmac_update(state, (const uint8_t*)message, msg_octets);
- sha1_final(&state->ctx, H);
+ srtp_sha1_final(&state->ctx, H);