From 93c7f15214a15932f3ff87fd92a4388c74d98efa Mon Sep 17 00:00:00 2001 From: Anakin Zheng Date: Mon, 19 May 2014 22:50:16 -0400 Subject: [PATCH] Use codesign verification to do dmc check --- Classes/smcWrapper.m | 37 ++++++++++++++++--------- smcFanControl.xcodeproj/project.pbxproj | 8 +++--- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/Classes/smcWrapper.m b/Classes/smcWrapper.m index 15d6e00..0477d31 100755 --- a/Classes/smcWrapper.m +++ b/Classes/smcWrapper.m @@ -24,8 +24,6 @@ #import "smcWrapper.h" #import -//TODO: This is the smcFanControl 2.5ß checksum, it needs to be updated for the next release. -NSString * const smc_checksum=@"03548c5634bd01315b19c46bf329cceb"; static NSArray *allSensors = nil; @@ -153,26 +151,39 @@ static NSArray *allSensors = nil; } -+ (NSString*)createCheckSum:(NSString*)path { - NSData *d=[NSData dataWithContentsOfMappedFile:path]; - unsigned char result[CC_MD5_DIGEST_LENGTH]; - CC_MD5((void *)[d bytes], [d length], result); - NSMutableString *ret = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH*2]; - int i; - for(i = 0; i