提交 c8686e47 编写于 作者: E Eugene Pankov

ppk passphrase support (fixes #281)

上级 b68f601f
...@@ -14,7 +14,9 @@ export class PromptModalComponent { ...@@ -14,7 +14,9 @@ export class PromptModalComponent {
) { } ) { }
ngOnInit () { ngOnInit () {
this.input.nativeElement.focus() setTimeout(() => {
this.input.nativeElement.focus()
})
} }
ok () { ok () {
......
...@@ -49,7 +49,11 @@ export class SSHService { ...@@ -49,7 +49,11 @@ export class SSHService {
if (privateKey) { if (privateKey) {
this.logger.info('Loaded private key from', privateKeyPath) this.logger.info('Loaded private key from', privateKeyPath)
if (privateKey.includes('ENCRYPTED')) { let encrypted = privateKey.includes('ENCRYPTED')
if (privateKeyPath.toLowerCase().endsWith('.ppk')) {
encrypted = encrypted || privateKey.includes('Encryption:') && !privateKey.includes('Encryption: none')
}
if (encrypted) {
let modal = this.ngbModal.open(PromptModalComponent) let modal = this.ngbModal.open(PromptModalComponent)
modal.componentInstance.prompt = 'Private key passphrase' modal.componentInstance.prompt = 'Private key passphrase'
modal.componentInstance.password = true modal.componentInstance.password = true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册