• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/libsrtp/0001-Rename-SHA1-functions-to-avoid-conflicts-with-downst.patch
Vicente Olivert RieraVicente Olivert Riera committed 08b7e4e534520 Apr 2016
Raw file
Source viewDiff to previous
xxxxxxxxxx
+static inline void srtp_sha1_update (srtp_sha1_ctx_t *ctx, const uint8_t *M, int octets_in_msg)
 
1
From f76eb65d008d0c8e06698e4a63a776e91b80155b Mon Sep 17 00:00:00 2001
2
From: jfigus <foleyj@cisco.com>
3
Date: Tue, 4 Nov 2014 14:54:02 -0500
4
Subject: [PATCH] Rename SHA1 functions to avoid conflicts with downstream
5
 packages.
6
​
7
Backported from upstream commit c270245a94ae9a007202754eb8f7ce9e48f97007
8
and tweaked to apply on top of v1.5.4.
9
​
10
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
11
---
12
 crypto/hash/hmac.c        | 20 ++++++++++----------
13
 crypto/hash/hmac_ossl.c   | 18 +++++++++---------
14
 crypto/hash/sha1.c        | 32 ++++++++++++++++----------------
15
 crypto/include/hmac.h     |  4 ++--
16
 crypto/include/sha1.h     | 34 +++++++++++++++++-----------------
17
 crypto/test/sha1_driver.c |  8 ++++----
18
 6 files changed, 58 insertions(+), 58 deletions(-)
19
​
20
diff --git a/crypto/hash/hmac.c b/crypto/hash/hmac.c
21
index ddb75ea..4bed61e 100644
22
--- a/crypto/hash/hmac.c
23
+++ b/crypto/hash/hmac.c
24
@@ -141,11 +141,11 @@ hmac_init(hmac_ctx_t *state, const uint8_t *key, int key_len) {
25
   debug_print(mod_hmac, "ipad: %s", octet_string_hex_string(ipad, 64));
26
   
27
   /* initialize sha1 context */
28
-  sha1_init(&state->init_ctx);
29
+  srtp_sha1_init(&state->init_ctx);
30
 
31
   /* hash ipad ^ key */
32
-  sha1_update(&state->init_ctx, ipad, 64);
33
-  memcpy(&state->ctx, &state->init_ctx, sizeof(sha1_ctx_t)); 
34
+  srtp_sha1_update(&state->init_ctx, ipad, 64);
35
+  memcpy(&state->ctx, &state->init_ctx, sizeof(srtp_sha1_ctx_t)); 
36
 
37
   return err_status_ok;
38
 }
39
@@ -153,7 +153,7 @@ hmac_init(hmac_ctx_t *state, const uint8_t *key, int key_len) {
40
 err_status_t
41
 hmac_start(hmac_ctx_t *state) {
42
     
43
-  memcpy(&state->ctx, &state->init_ctx, sizeof(sha1_ctx_t));
44
+  memcpy(&state->ctx, &state->init_ctx, sizeof(srtp_sha1_ctx_t));
45
 
46
   return err_status_ok;
47
 }
48
@@ -165,7 +165,7 @@ hmac_update(hmac_ctx_t *state, const uint8_t *message, int msg_octets) {
49
          octet_string_hex_string(message, msg_octets));
50
   
51
   /* hash message into sha1 context */
52
-  sha1_update(&state->ctx, message, msg_octets);
53
+  srtp_sha1_update(&state->ctx, message, msg_octets);
54
 
55
   return err_status_ok;
56
 }
57
@@ -183,7 +183,7 @@ hmac_compute(hmac_ctx_t *state, const void *message,
58
   
59
   /* hash message, copy output into H */
60
   hmac_update(state, (const uint8_t*)message, msg_octets);
61
-  sha1_final(&state->ctx, H);
62
+  srtp_sha1_final(&state->ctx, H);
63
 
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.