Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat Empty Passphrase as No Passphrase #35

Merged
merged 2 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ env_logger = "0.10.0"
rand = "0.8.5"
vt100 = "0.15.1"
openssl = { version = "0.10.45", features = ["vendored"] }
russh = { git = "https://github.com/mariotaku/russh", branch = "rsa-hash-override", features = ["openssl"] }
russh-keys = { git = "https://github.com/mariotaku/russh", branch = "rsa-hash-override", features = ["openssl"] }
russh = { git = "https://github.com/mariotaku/russh", rev = "42f0e2c", features = ["openssl"] }
russh-keys = { git = "https://github.com/mariotaku/russh", rev = "42f0e2c", features = ["openssl"] }
tokio = "1.24.2"
uuid = { version = "1.2.2", features = ["v1"] }
reqwest = "0.11.14"
Expand Down
1 change: 1 addition & 0 deletions src-tauri/src/device_manager/privkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ impl PrivateKey {
passphrase: Option<&str>,
hash: Option<SignatureHash>,
) -> Result<KeyPair, Error> {
let passphrase = passphrase.filter(|s| !s.is_empty());
return match self {
PrivateKey::Path { name } => {
load_secret_key_with_hash(ssh_dir().unwrap().join(name), passphrase.clone(), hash)
Expand Down
3 changes: 2 additions & 1 deletion src/app/add-device/add-device.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ export class AddDeviceComponent {
private async confirmVerificationFailure(device: NewDevice, e: Error): Promise<boolean> {
const ref = MessageDialogComponent.open(this.modalService, {
title: 'Verification Failed',
message: 'Add this device anyway?',
message: `Add ${device.name} anyway?`,
error: e,
positive: 'OK',
negative: 'Cancel',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ <h5 class="modal-title">{{title}}</h5>
<div class="modal-body" [ngSwitch]="messageType">
<p *ngSwitchCase="'string'">{{message}}</p>
<ng-template *ngSwitchCase="'component'" #messageComponent></ng-template>
<div class="card w-100 p-2" *ngIf="error">
<label class="card-title">More info about the error:</label>
<pre class="card-body w-100 p-0">{{error.message}}</pre>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary me-auto" (click)="modal.close(null)" *ngIf="alternative">{{alternative}}</button>
<button type="button" class="btn btn-secondary me-auto" (click)="modal.close(null)"
*ngIf="alternative">{{alternative}}</button>
<button type="button" class="btn btn-secondary" (click)="modal.close(false)" *ngIf="negative">{{negative}}</button>
<button type="button" class="btn" (click)="modal.close(true)" ngbAutofocus *ngIf="positive"
[ngClass]="['btn-' + positiveStyle]">{{positive}}</button>
<button type="button" class="btn" (click)="modal.close(true)" autofocus *ngIf="positive"
[ngClass]="['btn-' + positiveStyle]">{{positive}}</button>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class MessageDialogComponent implements AfterViewInit, MessageDialogConfi
alternative?: string;
positiveStyle?: ButtonStyle = 'primary';
messageExtras?: Record<string, any>;
error?: Error;

@ViewChild('messageComponent', {read: ViewContainerRef})
messageComponent?: ViewContainerRef;
Expand Down Expand Up @@ -83,5 +84,6 @@ export interface MessageDialogConfig {
negative?: string | null;
alternative?: string | null;
positiveStyle?: ButtonStyle;
error?: Error;
messageExtras?: { [keys: string]: any };
}