mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
stub libsignal::PrimaryProvisioningCipher.decrypt()
This commit is contained in:
parent
2e2d536dc8
commit
0e1c9595e4
2 changed files with 36 additions and 1 deletions
|
|
@ -175,8 +175,13 @@ impl Manager {
|
||||||
match ws.read() {
|
match ws.read() {
|
||||||
Ok(Message::Binary(registration)) => {
|
Ok(Message::Binary(registration)) => {
|
||||||
log::info!("raw registration ProtoBuffer: {:?}", registration);
|
log::info!("raw registration ProtoBuffer: {:?}", registration);
|
||||||
// TODO complete registration
|
log::info!("device name: {name}");
|
||||||
ws.close();
|
ws.close();
|
||||||
|
let provisioning_message = libsignal::ProvisionMessage::decode(identity_key_pair, registration);
|
||||||
|
log::info!("provisioning_message.number: {}", provisioning_message.number);
|
||||||
|
log::info!("provisioning_message.aci: {}", provisioning_message.aci);
|
||||||
|
log::info!("provisioning_message.pni: {}", provisioning_message.pni);
|
||||||
|
// TODO complete registration
|
||||||
Ok(true)
|
Ok(true)
|
||||||
}
|
}
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,36 @@
|
||||||
// this is a stub for a wrapped libsignal
|
// this is a stub for a wrapped libsignal
|
||||||
|
|
||||||
|
|
||||||
|
// use org.whispersystems.signalservice.internal.crypto.PrimaryProvisioningCipher;
|
||||||
|
pub struct PrimaryProvisioningCipher{}
|
||||||
|
impl PrimaryProvisioningCipher {
|
||||||
|
pub fn new(_stub: Option<String>) -> PrimaryProvisioningCipher {
|
||||||
|
PrimaryProvisioningCipher {}
|
||||||
|
}
|
||||||
|
pub fn decrypt(&self, _temp_identity: IdentityKeyPair, bytes: Vec<u8>) -> ProvisionMessage {
|
||||||
|
//log::info!("temp_identity: {:?}", temp_identity);
|
||||||
|
log::info!("raw uuid Protocol Buffer: {:?}", bytes);
|
||||||
|
ProvisionMessage {
|
||||||
|
number : "STUB number".to_string(),
|
||||||
|
aci : "STUB number".to_string(),
|
||||||
|
pni : "STUB number".to_string(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProvisionMessage {
|
||||||
|
pub number: String,
|
||||||
|
pub aci:String,
|
||||||
|
pub pni:String,
|
||||||
|
}
|
||||||
|
impl ProvisionMessage {
|
||||||
|
pub fn decode(temp_identity: IdentityKeyPair, bytes: Vec<u8>) -> ProvisionMessage {
|
||||||
|
let primary_provisioning_cipher = PrimaryProvisioningCipher::new(None);
|
||||||
|
primary_provisioning_cipher.decrypt(temp_identity, bytes)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// https://github.com/signalapp/Signal-Android/blob/d2053d2db7b1b930b7058ce5506dd6037ac3b808/libsignal-service/src/main/protowire/Provisioning.proto#L13C9-L15
|
// https://github.com/signalapp/Signal-Android/blob/d2053d2db7b1b930b7058ce5506dd6037ac3b808/libsignal-service/src/main/protowire/Provisioning.proto#L13C9-L15
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue