X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/9d8dbcc95c9e3ea959f034d5ddb2edcc71fe1f59..e5c183a31067923163f346d2fe64f367b0e0c542:/MTeSerialNumber.m diff --git a/MTeSerialNumber.m b/MTeSerialNumber.m index 9d8da42..a4882ce 100755 --- a/MTeSerialNumber.m +++ b/MTeSerialNumber.m @@ -1,6 +1,6 @@ #import "MTeSerialNumber.h" #import "validate.h" - +#import @interface MTeSerialNumber (Private) - (short)validate; @@ -19,7 +19,7 @@ extra:(NSString *)extra publisher:(NSString *)publisher { - if ( self = [super init] ) { + if ( (self = [super init]) ) { _serialNumber = serial; _nameBasedKey = name; _extraDataKey = nil; //extra data is currently unused. @@ -129,12 +129,16 @@ if ( _serialNumber ) { BOOL dead = NO; - + unsigned char *result = SHA1([[_serialNumber stringByAppendingString:@"-h4x0r"] UTF8String], [_serialNumber length] + 5, NULL); + if ([[[NSData dataWithBytes:result length:strlen(result)] description] isEqualToString:@""]) { + dead = YES; + } + if ( [_deadSerials count] ) { NSEnumerator *deadEnum = [_deadSerials objectEnumerator]; id aDeadSerial; - while ( aDeadSerial = [deadEnum nextObject] ) { + while ( (aDeadSerial = [deadEnum nextObject]) ) { if ( [aDeadSerial isEqualToString:_serialNumber] ) { dead = YES; }