Bug fix on marmot keypackage bundle (Buggy nsec)
This commit is contained in:
@@ -2,6 +2,7 @@ package at.torch.compose.database.model
|
||||
|
||||
import androidx.room3.Entity
|
||||
import androidx.room3.ForeignKey
|
||||
import androidx.room3.Index
|
||||
import androidx.room3.PrimaryKey
|
||||
import at.torch.compose.database.model.traits.BroadcastableEntity
|
||||
import at.torch.compose.database.model.traits.LocalStoreEntity
|
||||
@@ -12,14 +13,17 @@ import kotlin.time.Clock
|
||||
import kotlin.time.Instant
|
||||
|
||||
@Entity(
|
||||
foreignKeys = [
|
||||
ForeignKey(
|
||||
entity = Profile::class,
|
||||
parentColumns = ["publicKey"],
|
||||
childColumns = ["publicKey"],
|
||||
onDelete = ForeignKey.CASCADE,
|
||||
),
|
||||
]
|
||||
// foreignKeys = [
|
||||
// ForeignKey(
|
||||
// entity = Profile::class,
|
||||
// parentColumns = ["publicKey"],
|
||||
// childColumns = ["publicKey"],
|
||||
// onDelete = ForeignKey.CASCADE,
|
||||
// ),
|
||||
// ],
|
||||
indices = [
|
||||
Index("publicKey"),
|
||||
],
|
||||
)
|
||||
data class MarmotKeyPackageBundle(
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
|
||||
@@ -29,9 +29,9 @@ class DatabaseMarmotRepository(
|
||||
MarmotKeyPackageBundle(
|
||||
publicKey = publicKey,
|
||||
tlsEncodedMarmotKeyPackage = tlsWriter.toByteArray().toHex(),
|
||||
ncryptsecInitPrivateKey = nip49.encrypt(keyPackageBundle.initPrivateKey.toHex(), nsecPassword), // TODO: ncryptSec this using the private key
|
||||
ncryptsecEncryptionPrivateKey = nip49.encrypt(keyPackageBundle.encryptionPrivateKey.toHex(), nsecPassword), // TODO: ncryptSec this using the private key
|
||||
ncryptsecSignaturePrivateKey = nip49.encrypt(keyPackageBundle.signaturePrivateKey.toHex(), nsecPassword) // TODO: ncryptSec this using the private key
|
||||
ncryptsecInitPrivateKey = keyPackageBundle.initPrivateKey.toHex(), // TODO: ncryptSec this using the private key
|
||||
ncryptsecEncryptionPrivateKey = keyPackageBundle.encryptionPrivateKey.toHex(), // TODO: ncryptSec this using the private key
|
||||
ncryptsecSignaturePrivateKey = keyPackageBundle.signaturePrivateKey.toHex() // TODO: ncryptSec this using the private key
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package at.torch.compose.database.repository
|
||||
|
||||
import at.torch.compose.database.model.Profile
|
||||
import at.torch.compose.database.model.UnsignedNostrEvent
|
||||
import at.torch.compose.nostr.Relays
|
||||
import co.touchlab.kermit.Logger
|
||||
|
||||
Reference in New Issue
Block a user