Add TODOs

pull/300/head
nielsandriesse 5 years ago
parent da8fd5d56d
commit 829ee5d267

@ -113,6 +113,7 @@ public final class PublicChatMessage : NSObject {
return nil
}
let userKeyPair = OWSIdentityManager.shared().identityKeyPair()!
// TODO: Sign using the ED25519 private key here
guard let signatureData = try? Ed25519.sign(data, with: userKeyPair) else {
print("[Loki] Failed to sign public chat message.")
return nil

@ -22,6 +22,7 @@ public final class DeviceLinkingUtilities : NSObject {
let slavePublicKey = slaveKeyPair.hexEncodedPublicKey
var kind = UInt8(LKDeviceLinkMessageKind.request.rawValue)
let data = Data(hex: masterPublicKey) + Data(bytes: &kind, count: MemoryLayout.size(ofValue: kind))
// TODO: Sign using the ED25519 private key here
let slaveSignature = try! Ed25519.sign(data, with: slaveKeyPair)
let thread = TSContactThread.getOrCreateThread(contactId: masterPublicKey)
return DeviceLinkMessage(in: thread, masterPublicKey: masterPublicKey, slavePublicKey: slavePublicKey, masterSignature: nil, slaveSignature: slaveSignature)
@ -33,6 +34,7 @@ public final class DeviceLinkingUtilities : NSObject {
let slavePublicKey = deviceLink.slave.publicKey
var kind = UInt8(LKDeviceLinkMessageKind.authorization.rawValue)
let data = Data(hex: slavePublicKey) + Data(bytes: &kind, count: MemoryLayout.size(ofValue: kind))
// TODO: Sign using the ED25519 private key here
let masterSignature = try! Ed25519.sign(data, with: masterKeyPair)
let slaveSignature = deviceLink.slave.signature!
let thread = TSContactThread.getOrCreateThread(contactId: slavePublicKey)

@ -32,6 +32,7 @@ NSString *const OWSPrimaryStorageKeyPrekeyCurrentSignedPrekeyId = @"currentSigne
OWSAssert(identityKeyPair);
@try {
// TODO: Sign using the ED25519 private key here
NSData *signature = [Ed25519 throws_sign:keyPair.publicKey.prependKeyType withKeyPair:identityKeyPair];
return [[SignedPreKeyRecord alloc] initWithId:preKeyId
keyPair:keyPair

Loading…
Cancel
Save