Skip to content

Commit

Permalink
merge incoming conns and "authorized" section
Browse files Browse the repository at this point in the history
  • Loading branch information
feschber committed Sep 28, 2024
1 parent 932a25e commit 8f33cfd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 44 deletions.
13 changes: 9 additions & 4 deletions lan-mouse-gtk/resources/fingerprint_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<property name="modal">True</property>
<property name="width-request">880</property>
<property name="default-width">880</property>
<property name="height-request">340</property>
<property name="default-height">340</property>
<property name="title" translatable="yes">Add Public Key Fingerprint</property>
<property name="height-request">380</property>
<property name="default-height">380</property>
<property name="title" translatable="yes">Add Certificate Fingerprint</property>
<property name="content">
<object class="AdwToolbarView">
<child type="top">
Expand All @@ -24,7 +24,12 @@
<property name="spacing">18</property>
<child>
<object class="GtkLabel">
<property name="label">you can find the fingerprint of a device under the `General` section</property>
<property name="label">The certificate fingerprint serves as a unique identifier for your device.</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">You can find it under the `General` section of the device you want to connect</property>
</object>
</child>
<child>
Expand Down
27 changes: 4 additions & 23 deletions lan-mouse-gtk/resources/window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
</child>
<child>
<object class="AdwActionRow" id="fingerprint_row">
<property name="title">public key fingerprint</property>
<property name="title">certificate fingerprint</property>
<property name="icon-name">auth-fingerprint-symbolic</property>
<child>
<object class="GtkButton" id="copy-fingerprint-button">
Expand Down Expand Up @@ -229,32 +229,13 @@
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Incoming Connections</property>
<child>
<object class="GtkListBox" id="connection_list">
<property name="selection-mode">none</property>
<child type="placeholder">
<object class="AdwActionRow">
<property name="title">no incoming connections!</property>
<property name="subtitle">devices that control this pc will show up here</property>
</object>
</child>
<style>
<class name="boxed-list" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Authorized Keys</property>
<property name="header-suffix">
<object class="GtkButton">
<signal name="clicked" handler="handle_add_cert_fingerprint" swapped="true"/>
<property name="child">
<object class="AdwButtonContent">
<property name="icon-name">auth-fingerprint-symbolic</property>
<property name="label" translatable="yes">Add</property>
<property name="label" translatable="yes">Authorize</property>
</object>
</property>
<style>
Expand All @@ -267,8 +248,8 @@
<property name="selection-mode">none</property>
<child type="placeholder">
<object class="AdwActionRow" id="authorized_placeholder">
<property name="title">no fingerprints!</property>
<property name="subtitle">add a public key fingerprint via the + button</property>
<property name="title">no devices registered!</property>
<property name="subtitle">authorize a new device via the "Authorize" button</property>
</object>
</child>
<style>
Expand Down
17 changes: 0 additions & 17 deletions src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,10 @@ use webrtc_dtls::crypto::Certificate;

#[derive(Debug, Error)]
pub enum Error {
#[error("block is not a private key, unable to load key")]
ErrBlockIsNotPrivateKey,
#[error("unknown key time in PKCS#8 wrapping, unable to load key")]
ErrUnknownKeyTime,
#[error("no private key found, unable to load key")]
ErrNoPrivateKeyFound,
#[error("block is not a certificate, unable to load certificates")]
ErrBlockIsNotCertificate,
#[error("no certificate found, unable to load certificates")]
ErrNoCertificateFound,

#[error(transparent)]
Io(#[from] io::Error),
#[error(transparent)]
Dtls(#[from] webrtc_dtls::Error),
#[error("{0}")]
Other(String),
#[error("a file containing the public key is missing")]
PkMissing,
#[error("a file containing the private key is missing")]
SkMissing,
}

pub fn generate_fingerprint(cert: &[u8]) -> String {
Expand Down

0 comments on commit 8f33cfd

Please sign in to comment.