summaryrefslogtreecommitdiffstats
path: root/ldid.cpp
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2015-08-23 02:21:23 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2015-08-23 02:22:36 -0700
commita50bb1be22d0a00cf4c1dad006f8cda253b23228 (patch)
tree73431885e1197024fa464e04db93ad34d065e229 /ldid.cpp
parentd840a088528979cddcf722a2a19abefc0151a1ed (diff)
downloadldid-a50bb1be22d0a00cf4c1dad006f8cda253b23228.tar.gz
ldid-a50bb1be22d0a00cf4c1dad006f8cda253b23228.tar.zst
ldid-a50bb1be22d0a00cf4c1dad006f8cda253b23228.zip
Use OpenSSL to implement SHA1 instead of our copy.
Diffstat (limited to 'ldid.cpp')
-rw-r--r--ldid.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/ldid.cpp b/ldid.cpp
index e1fbda9..c2227a5 100644
--- a/ldid.cpp
+++ b/ldid.cpp
@@ -23,14 +23,12 @@
#include "minimal/string.h"
#include "minimal/mapping.h"
-extern "C" {
-#include "sha1.h"
-}
-
#include <cstring>
#include <string>
#include <vector>
+#include <openssl/sha.h>
+
#include <plist/plist.h>
struct fat_header {
@@ -719,10 +717,7 @@ struct CodeDirectory {
extern "C" uint32_t hash(uint8_t *k, uint32_t length, uint32_t initval);
void sha1(uint8_t *hash, uint8_t *data, size_t size) {
- SHA1Context context;
- SHA1Reset(&context);
- SHA1Input(&context, data, size);
- SHA1Result(&context, hash);
+ SHA1(data, size, hash);
}
struct CodesignAllocation {