public bool Vefiry(ISSHLoginParameter param, SSHConnectionInfo info) {
     if (_verifier == null)
         _verifier = FindHostKeyVerifier();
     if (_verifier == null)
         return true; //普通KnownHostsくらいはあるだろう。エラーにすべきかもしれないが
     else
         return _verifier.Verify(param, info);
 }
Beispiel #2
0
 public bool Vefiry(ISSHLoginParameter param, SSHConnectionInfo info)
 {
     if (_verifier == null)
         _verifier = FindHostKeyVerifier();
     if (_verifier == null)
         return true; //����KnownHosts���炢�͂��邾�낤�B�G���[�ɂ��ׂ��������Ȃ���
     else
         return _verifier.Verify(param, info);
 }
Beispiel #3
0
        private bool AskUserReliability(ISSHLoginParameter param, SSHConnectionInfo info, string keystr, string message_text_id) {
            //比較結果に基づく処理
            IPoderosaForm form = UsabilityPlugin.Instance.WindowManager.ActiveWindow;
            Debug.Assert(form.AsForm().InvokeRequired); //別スレッドで実行しているはず

            //fingerprint
            StringBuilder bld = new StringBuilder();
            byte[] fingerprint = info.HostKeyMD5FingerPrint();
            for (int i = 0; i < fingerprint.Length; i++) {
                if (bld.Length > 0)
                    bld.Append(':');
                bld.Append(fingerprint[i].ToString("x2"));
            }

            string message = String.Format("ssh hostkey fingerprint {0}\n\n{1}", bld.ToString(), UsabilityPlugin.Strings.GetString(message_text_id));

            if (form.AskUserYesNo(message) == DialogResult.Yes) {
                Update(param, keystr, true);
                return true;
            }
            else
                return false;
        }
Beispiel #4
0
        public bool Verify(ISSHLoginParameter param, SSHConnectionInfo info) {
            if (!_loaded) {
                try {
                    Load();
                }
                catch (Exception ex) { //ロード中のエラーのときは鍵は拒否。安全側に!
                    RuntimeUtil.ReportException(ex);
                    return false;
                }
            }

            string keystr = info.DumpHostKeyInKnownHostsStyle();
            string local = param.Method == SSHProtocol.SSH1 ? _dataForSSH1[ToKeyString(param)] : _dataForSSH2[ToKeyString(param)];

            if (local == null) {
                return AskUserReliability(param, info, keystr, "Message.HostKeyChecker.AskHostKeyRegister");
            }
            else if (keystr != local) {
                return AskUserReliability(param, info, keystr, "Message.HostKeyChecker.AskHostKeyRenew");
            }
            else
                return true;
        }
Beispiel #5
0
 private bool CheckKey(SSHConnectionInfo ci)
 {
     return _keycheck.Vefiry(_destination, ci);
 }
 //ISSHHostKeyVerifier
 public bool Verify(ISSHLoginParameter param, SSHConnectionInfo info) {
     return _acceptsHostKey;
 }
 private bool CheckKey(SSHConnectionInfo ci) {
     SetIgnoreTimeout(); //これが呼ばれるということは途中までSSHのネゴシエートができているのでタイムアウトはしないようにする
     return _keycheck(ci);
 }
 private bool CheckKey(SSHConnectionInfo ci)
 {
     SetIgnoreTimeout(); //���ꂪ�Ă΂��Ƃ������Ƃ͓r���܂�SSH�̃l�S�V�G�[�g���ł��Ă���̂Ń^�C���A�E�g�͂��Ȃ��悤�ɂ���
     return _keycheck(ci);
 }