adium/adium

Replaced OpenSSL with Common Crypto for SHA1 in Bonjour.
adium-1.5.10.3
2017-03-21, Thijs Alkemade
297f01718b75
Parents 297d0d30e457
Children 81732180bddf
Replaced OpenSSL with Common Crypto for SHA1 in Bonjour.

Fixes #17093
--- a/Plugins/Bonjour/libezv/Private Classes/AWEzvContactManagerRendezvous.m Tue Mar 21 20:53:24 2017 +0100
+++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvContactManagerRendezvous.m Tue Mar 21 21:09:53 2017 +0100
@@ -40,7 +40,7 @@
#import "AWEzvSupportRoutines.h"
#import <dns_sd.h>
-#import <openssl/sha.h>
+#include <CommonCrypto/CommonDigest.h>
/* One of the stupidest things I've ever met. Doing DNS lookups using the standard
* functions does not for mDNS records work unless you're in BIND 8 compatibility
@@ -331,8 +331,7 @@
- (void)setImageData:(NSData *)JPEGData
{
DNSServiceErrorType error;
- SHA_CTX ctx;
- unsigned char digest[20];
+ unsigned char digest[CC_SHA1_DIGEST_LENGTH];
if (avDNSReference == NULL) {
[[client client] reportError:@"Error setting image data" ofLevel:AWEzvWarning];
@@ -382,9 +381,7 @@
if (error == kDNSServiceErr_NoError) {
// Let's create the hash
- SHA1_Init(&ctx);
- SHA1_Update(&ctx, [JPEGData bytes], (unsigned long)[JPEGData length]);
- SHA1_Final(digest, &ctx);
+ CC_SHA1([JPEGData bytes], (CC_LONG)[JPEGData length], digest);
imagehash = [[NSData dataWithBytes:digest length:20] retain];
AILogWithSignature(@"Will update with hash %@; length is %u", imagehash, [JPEGData length]);
[self updatePHSH];