Private
Public Access
1
0

Some additional headers needed to decrypt the payload

This commit is contained in:
James Magahern
2018-11-15 16:30:25 -08:00
parent 6c9996dfa1
commit 5ced6151c2

View File

@@ -30,7 +30,15 @@ static NSString *const kSymmetricKey = @"axPy0nljtG/TOVJSVwVXag==";
NSLog(@"Error encrypting response: %@", error);
}
return [[self alloc] initWithData:encryptedData contentType:@"application/octet-stream"];
NSString *ivDataString = [ivData base64EncodedStringWithOptions:0];
GCDWebServerDataResponse *response = [[self alloc] initWithData:encryptedData contentType:@"application/octet-stream"];
[response setValue:ivDataString forAdditionalHeader:@"X-KordophoneCrypto-IV"];
// TODO: is this the right way??
[response setValue:[NSString stringWithFormat:@"%lu", (unsigned long)[data length]] forAdditionalHeader:@"X-Decrypted-Content-Length"];
return response;
}
@end