|
|
@ -624,6 +624,7 @@ NSError *ContactDiscoveryServiceErrorMakeWithReason(NSInteger code, NSString *re
|
|
|
|
[dateFormatter setDateFormat:@"yyy-MM-dd'T'HH:mm:ss.SSSSSS"];
|
|
|
|
[dateFormatter setDateFormat:@"yyy-MM-dd'T'HH:mm:ss.SSSSSS"];
|
|
|
|
NSDate *timestampDate = [dateFormatter dateFromString:signatureBodyEntity.timestamp];
|
|
|
|
NSDate *timestampDate = [dateFormatter dateFromString:signatureBodyEntity.timestamp];
|
|
|
|
if (!timestampDate) {
|
|
|
|
if (!timestampDate) {
|
|
|
|
|
|
|
|
OWSFailDebug(@"Could not parse signature body timestamp: %@", signatureBodyEntity.timestamp);
|
|
|
|
*error = ContactDiscoveryServiceErrorMakeWithReason(
|
|
|
|
*error = ContactDiscoveryServiceErrorMakeWithReason(
|
|
|
|
ContactDiscoveryServiceErrorAssertionError, @"could not parse signature body timestamp.");
|
|
|
|
ContactDiscoveryServiceErrorAssertionError, @"could not parse signature body timestamp.");
|
|
|
|
return NO;
|
|
|
|
return NO;
|
|
|
@ -639,6 +640,7 @@ NSError *ContactDiscoveryServiceErrorMakeWithReason(NSInteger code, NSString *re
|
|
|
|
BOOL isExpired = [now isAfterDate:timestampDatePlus1Day];
|
|
|
|
BOOL isExpired = [now isAfterDate:timestampDatePlus1Day];
|
|
|
|
|
|
|
|
|
|
|
|
if (isExpired) {
|
|
|
|
if (isExpired) {
|
|
|
|
|
|
|
|
OWSFailDebug(@"Could not parse signature body timestamp: %@", signatureBodyEntity.timestamp);
|
|
|
|
*error = ContactDiscoveryServiceErrorMakeWithReason(
|
|
|
|
*error = ContactDiscoveryServiceErrorMakeWithReason(
|
|
|
|
ContactDiscoveryServiceErrorAttestationFailed, @"Signature is expired.");
|
|
|
|
ContactDiscoveryServiceErrorAttestationFailed, @"Signature is expired.");
|
|
|
|
return NO;
|
|
|
|
return NO;
|
|
|
|