• 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/libstrophe/0001-Namespace-SHA-functions.patch
Thomas PetazzoniThomas Petazzoni committed 32a20319c1702 Jul 2017
Raw file
Source viewDiff to previous
 
1
From b08766c8e46956daba010044b00c97f78b598780 Mon Sep 17 00:00:00 2001
2
From: Michael Santos <michael.santos@gmail.com>
3
Date: Sun, 24 May 2015 10:55:02 -0400
4
Subject: [PATCH] Namespace SHA functions
5
​
6
Fix statically linking against libstrophe by renaming the internal SHA
7
functions:
8
​
9
https://github.com/strophe/libstrophe/issues/40
10
​
11
Although the same function names are used by libstrophe and OpenSSL,
12
the signatures and contexts of the SHA functions differ, resulting in
13
a segfault if the OpenSSL versions are substituted.
14
​
15
[Upstream commit: https://github.com/msantos/libstrophe/commit/b08766c8e46956daba010044b00c97f78b598780]
16
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
17
---
18
 src/auth.c  |  8 ++++----
19
 src/scram.c | 22 +++++++++++-----------
20
 src/sha1.c  | 30 +++++++++++++++---------------
21
 src/sha1.h  |  6 +++---
22
 4 files changed, 33 insertions(+), 33 deletions(-)
23
​
24
diff --git a/src/auth.c b/src/auth.c
25
index b06f18c..3506977 100644
26
--- a/src/auth.c
27
+++ b/src/auth.c
28
@@ -1187,10 +1187,10 @@ int _handle_component_auth(xmpp_conn_t * const conn)
29
     /* Feed the session id and passphrase to the algorithm.
30
      * We need to compute SHA1(session_id + passphrase)
31
      */
32
-    SHA1_Init(&mdctx);
33
-    SHA1_Update(&mdctx, (uint8_t*)conn->stream_id, strlen(conn->stream_id));
34
-    SHA1_Update(&mdctx, (uint8_t*)conn->pass, strlen(conn->pass));
35
-    SHA1_Final(&mdctx, md_value);
36
+    xmpp_SHA1_Init(&mdctx);
37
+    xmpp_SHA1_Update(&mdctx, (uint8_t*)conn->stream_id, strlen(conn->stream_id));
38
+    xmpp_SHA1_Update(&mdctx, (uint8_t*)conn->pass, strlen(conn->pass));
39
+    xmpp_SHA1_Final(&mdctx, md_value);
40
 
41
     digest = xmpp_alloc(conn->ctx, 2*sizeof(md_value)+1);
42
     if (digest) {
43
diff --git a/src/scram.c b/src/scram.c
44
index 5cce168..6e420e1 100644
45
--- a/src/scram.c
46
+++ b/src/scram.c
47
@@ -37,9 +37,9 @@ static void SHA1(const uint8_t* data, size_t len,
48
                  uint8_t digest[SHA1_DIGEST_SIZE])
49
 {
50
     SHA1_CTX ctx;
51
-    SHA1_Init(&ctx);
52
-    SHA1_Update(&ctx, data, len);
53
-    SHA1_Final(&ctx, digest);
54
+    xmpp_SHA1_Init(&ctx);
55
+    xmpp_SHA1_Update(&ctx, data, len);
56
+    xmpp_SHA1_Final(&ctx, digest);
57
 }
58
 
59
 static void HMAC_SHA1(const uint8_t *key, size_t key_len,
60
@@ -66,15 +66,15 @@ static void HMAC_SHA1(const uint8_t *key, size_t key_len,
61
         key_opad[i] = key_pad[i] ^ opad;
62
     }
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.