diff --git a/kordophone/Crypto/GCDWebServerDataResponse+Crypto.m b/kordophone/Crypto/GCDWebServerDataResponse+Crypto.m index 99a76dd..793b83a 100644 --- a/kordophone/Crypto/GCDWebServerDataResponse+Crypto.m +++ b/kordophone/Crypto/GCDWebServerDataResponse+Crypto.m @@ -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