#import "MTeSerialNumber.h"
#import "validate.h"
-
+#import <openssl/sha.h>
@interface MTeSerialNumber (Private)
- (short)validate;
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.
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:@"<db7ea71c 2919ff4b 520b6491 8d6813db b70647>"]) {
+ 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;
}