diff options
author | 2023-07-04 17:14:27 +0200 | |
---|---|---|
committer | 2023-07-04 17:14:27 +0200 | |
commit | 474fd9284b76d8ddd3a3aec41cbca3cc48271cc1 (patch) | |
tree | 58fcb909dff8cee2d2121d17bf0643fad6a8e766 /3rd_party/libsrp6a-sha512/t_sha.h | |
parent | 52ab7b76f76ee0464fd150ec881ce50fbf2dc001 (diff) | |
download | libimobiledevice-474fd9284b76d8ddd3a3aec41cbca3cc48271cc1.tar.gz libimobiledevice-474fd9284b76d8ddd3a3aec41cbca3cc48271cc1.tar.bz2 |
3rd_party/libsrp6a-sha512: Updated to work with OpenSSL 3.0+ API
Diffstat (limited to '3rd_party/libsrp6a-sha512/t_sha.h')
-rw-r--r-- | 3rd_party/libsrp6a-sha512/t_sha.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/3rd_party/libsrp6a-sha512/t_sha.h b/3rd_party/libsrp6a-sha512/t_sha.h index 18deec5..2e38067 100644 --- a/3rd_party/libsrp6a-sha512/t_sha.h +++ b/3rd_party/libsrp6a-sha512/t_sha.h | |||
@@ -38,6 +38,28 @@ | |||
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #ifdef OPENSSL_SHA | 40 | #ifdef OPENSSL_SHA |
41 | #include <openssl/err.h> | ||
42 | #if OPENSSL_VERSION_NUMBER >= 0x30000000L | ||
43 | #include <openssl/evp.h> | ||
44 | |||
45 | typedef EVP_MD_CTX* SHA1_CTX; | ||
46 | #define SHA1Init SHA1Init_openssl | ||
47 | #define SHA1Update SHA1Update_openssl | ||
48 | #define SHA1Final SHA1Final_openssl | ||
49 | |||
50 | typedef EVP_MD_CTX* SHA512_CTX; | ||
51 | #define SHA512Init SHA512Init_openssl | ||
52 | #define SHA512Update SHA512Update_openssl | ||
53 | #define SHA512Final SHA512Final_openssl | ||
54 | |||
55 | void SHA1Init_openssl(SHA1_CTX *ctx); | ||
56 | void SHA1Update_openssl(SHA1_CTX *ctx, const void *data, unsigned int len); | ||
57 | void SHA1Final_openssl(unsigned char digest[20], SHA1_CTX *ctx); | ||
58 | |||
59 | void SHA512Init_openssl(SHA512_CTX *ctx); | ||
60 | void SHA512Update_openssl(SHA512_CTX *ctx, const void *data, unsigned int len); | ||
61 | void SHA512Final_openssl(unsigned char digest[64], SHA1_CTX *ctx); | ||
62 | #else /* for OpenSSL < 3.0 */ | ||
41 | #include <openssl/sha.h> | 63 | #include <openssl/sha.h> |
42 | 64 | ||
43 | typedef SHA_CTX SHA1_CTX; | 65 | typedef SHA_CTX SHA1_CTX; |
@@ -48,7 +70,7 @@ typedef SHA_CTX SHA1_CTX; | |||
48 | #define SHA512Init SHA512_Init | 70 | #define SHA512Init SHA512_Init |
49 | #define SHA512Update SHA512_Update | 71 | #define SHA512Update SHA512_Update |
50 | #define SHA512Final SHA512_Final | 72 | #define SHA512Final SHA512_Final |
51 | 73 | #endif /* for OpenSSL < 3.0 */ | |
52 | #elif defined(TOMCRYPT_SHA) | 74 | #elif defined(TOMCRYPT_SHA) |
53 | /* mycrypt.h already included above */ | 75 | /* mycrypt.h already included above */ |
54 | 76 | ||