Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
81e7b10a
Commit
81e7b10a
authored
Oct 23, 2012
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1012 from carlosmn/libcrypto-sha
Use libcrypto's SHA-1 implementation when linking to it
parents
5b67d145
7205a4d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
CMakeLists.txt
+4
-2
src/sha1.h
+7
-0
src/sha1/sha1.c
+0
-0
No files found.
CMakeLists.txt
View file @
81e7b10a
...
...
@@ -40,8 +40,10 @@ ENDIF()
IF
(
SHA1_TYPE STREQUAL
"ppc"
)
ADD_DEFINITIONS
(
-DPPC_SHA1
)
FILE
(
GLOB SRC_SHA1 src/ppc/*.c src/ppc/*.S
)
ELSEIF
(
OPENSSL_FOUND
)
# libcrypto's implementation is faster than ours
ADD_DEFINITIONS
(
-DOPENSSL_SHA
)
ELSE
()
SET
(
SRC_SHA1
)
FILE
(
GLOB SRC_SHA1 src/sha1/*.c
)
ENDIF
()
IF
(
NOT WIN32
)
...
...
@@ -193,7 +195,7 @@ IF (BUILD_CLAR)
DEPENDS
${
CLAR_PATH
}
/clar
${
SRC_TEST
}
WORKING_DIRECTORY
${
CLAR_PATH
}
)
ADD_EXECUTABLE(libgit2_clar
${
SRC
}
${
CLAR_PATH
}
/clar_main.c
${
SRC_TEST
}
${
SRC_ZLIB
}
${
SRC_HTTP
}
${
SRC_REGEX
}
)
ADD_EXECUTABLE(libgit2_clar
${
SRC
}
${
CLAR_PATH
}
/clar_main.c
${
SRC_TEST
}
${
SRC_ZLIB
}
${
SRC_HTTP
}
${
SRC_REGEX
}
${
SRC_SHA1
}
)
TARGET_LINK_LIBRARIES(libgit2_clar
${
CMAKE_THREAD_LIBS_INIT
}
${
SSL_LIBRARIES
}
)
IF (MSVC)
...
...
src/sha1.h
View file @
81e7b10a
...
...
@@ -8,12 +8,17 @@
#ifndef INCLUDE_sha1_h__
#define INCLUDE_sha1_h__
#ifdef OPENSSL_SHA
# include <openssl/sha.h>
#else
typedef
struct
{
unsigned
long
long
size
;
unsigned
int
H
[
5
];
unsigned
int
W
[
16
];
}
blk_SHA_CTX
;
void
git__blk_SHA1_Init
(
blk_SHA_CTX
*
ctx
);
void
git__blk_SHA1_Update
(
blk_SHA_CTX
*
ctx
,
const
void
*
dataIn
,
size_t
len
);
void
git__blk_SHA1_Final
(
unsigned
char
hashout
[
20
],
blk_SHA_CTX
*
ctx
);
...
...
@@ -23,4 +28,6 @@ void git__blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx);
#define SHA1_Update git__blk_SHA1_Update
#define SHA1_Final git__blk_SHA1_Final
#endif // OPENSSL_SHA
#endif
src/sha1.c
→
src/sha1
/sha1
.c
View file @
81e7b10a
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment