Пример #1
0
        public bool Commit(IProtocolOptions options, IKeyAgentOptions agent)
        {
            StringResource sr = OptionDialogPlugin.Instance.Strings;

            //暗号アルゴリズム順序はoptionsを直接いじっているのでここでは何もしなくてよい
            try {
                options.HostKeyAlgorithmOrder = GetHostKeyAlgorithmOrder();

                try {
                    options.SSHWindowSize = Int32.Parse(_windowSizeBox.Text);
                }
                catch (FormatException) {
                    GUtil.Warning(this, sr.GetString("Message.OptionDialog.InvalidWindowSize"));
                    return(false);
                }

                options.SSHCheckMAC          = _sshCheckMAC.Checked;
                options.CipherAlgorithmOrder = GetCipherAlgorithmOrder();
                options.LogSSHEvents         = _sshEventLog.Checked;

                return(true);
            }
            catch (Exception ex) {
                GUtil.Warning(this, ex.Message);
                return(false);
            }
        }
Пример #2
0
        public bool Commit(IProtocolOptions options, IKeyAgentOptions agent)
        {
            StringResource sr = OptionDialogPlugin.Instance.Strings;
            //暗号アルゴリズム順序はoptionsを直接いじっているのでここでは何もしなくてよい
            try {
                options.HostKeyAlgorithmOrder = GetHostKeyAlgorithmOrder();

                try {
                    options.SSHWindowSize = Int32.Parse(_windowSizeBox.Text);
                }
                catch (FormatException) {
                    GUtil.Warning(this, sr.GetString("Message.OptionDialog.InvalidWindowSize"));
                    return false;
                }

                options.RetainsPassphrase = _retainsPassphrase.Checked;
                options.SSHCheckMAC = _sshCheckMAC.Checked;
                options.CipherAlgorithmOrder = GetCipherAlgorithmOrder();
                options.LogSSHEvents = _sshEventLog.Checked;

                return true;
            }
            catch (Exception ex) {
                GUtil.Warning(this, ex.Message);
                return false;
            }
        }
Пример #3
0
 public void InitUI(IProtocolOptions options, IKeyAgentOptions agent)
 {
     _cipherOrderList.Items.Clear();
     _cipherOrderList.Items.AddRange(ToCipherAlgorithmListItems(options.CipherAlgorithmOrder));
     _hostKeyAlgorithmOrderList.Items.Clear();
     _hostKeyAlgorithmOrderList.Items.AddRange(ToPublicKeyAlgorithmListItems(options.HostKeyAlgorithmOrder));
     _windowSizeBox.Text  = options.SSHWindowSize.ToString();
     _sshCheckMAC.Checked = options.SSHCheckMAC;
     _sshEventLog.Checked = options.LogSSHEvents;
 }
 public void InitUI(IProtocolOptions options, IKeyAgentOptions agent)
 {
     _cipherOrderList.Items.Clear();
     string[] co = options.CipherAlgorithmOrder;
     foreach (string c in co)
     {
         _cipherOrderList.Items.Add(c);
     }
     _hostKeyBox.SelectedIndex   = ParsePublicKeyAlgorithm(options.HostKeyAlgorithmOrder[0]) == PublicKeyAlgorithm.DSA? 0 : 1;         //これはDSA/RSAのどちらかしかない
     _windowSizeBox.Text         = options.SSHWindowSize.ToString();
     _retainsPassphrase.Checked  = options.RetainsPassphrase;
     _sshCheckMAC.Checked        = options.SSHCheckMAC;
     _sshEventLog.Checked        = options.LogSSHEvents;
     _cipherAlgorithmOrder       = options.CipherAlgorithmOrder;
     _enableAgentForward.Checked = agent.EnableKeyAgent;
 }
        public bool Commit(IProtocolOptions options, IKeyAgentOptions agent)
        {
            StringResource sr = OptionDialogPlugin.Instance.Strings;

            //暗号アルゴリズム順序はoptionsを直接いじっているのでここでは何もしなくてよい
            try {
                PublicKeyAlgorithm[] pa = new PublicKeyAlgorithm[2];
                if (_hostKeyBox.SelectedIndex == 0)
                {
                    pa[0] = PublicKeyAlgorithm.DSA;
                    pa[1] = PublicKeyAlgorithm.RSA;
                }
                else
                {
                    pa[0] = PublicKeyAlgorithm.RSA;
                    pa[1] = PublicKeyAlgorithm.DSA;
                }
                options.HostKeyAlgorithmOrder = FormatPublicKeyAlgorithmList(pa);

                try {
                    options.SSHWindowSize = Int32.Parse(_windowSizeBox.Text);
                }
                catch (FormatException) {
                    GUtil.Warning(this, sr.GetString("Message.OptionDialog.InvalidWindowSize"));
                    return(false);
                }

                options.RetainsPassphrase    = _retainsPassphrase.Checked;
                options.SSHCheckMAC          = _sshCheckMAC.Checked;
                options.CipherAlgorithmOrder = _cipherAlgorithmOrder;
                options.LogSSHEvents         = _sshEventLog.Checked;
                agent.EnableKeyAgent         = _enableAgentForward.Checked;

                return(true);
            }
            catch (Exception ex) {
                GUtil.Warning(this, ex.Message);
                return(false);
            }
        }
Пример #6
0
        public bool Commit(IProtocolOptions options, IKeyAgentOptions agent)
        {
            StringResource sr = OptionDialogPlugin.Instance.Strings;
            //暗号アルゴリズム順序はoptionsを直接いじっているのでここでは何もしなくてよい
            try {
                PublicKeyAlgorithm[] pa = new PublicKeyAlgorithm[2];
                if (_hostKeyBox.SelectedIndex == 0) {
                    pa[0] = PublicKeyAlgorithm.DSA;
                    pa[1] = PublicKeyAlgorithm.RSA;
                }
                else {
                    pa[0] = PublicKeyAlgorithm.RSA;
                    pa[1] = PublicKeyAlgorithm.DSA;
                }
                options.HostKeyAlgorithmOrder = FormatPublicKeyAlgorithmList(pa);

                try {
                    options.SSHWindowSize = Int32.Parse(_windowSizeBox.Text);
                }
                catch (FormatException) {
                    GUtil.Warning(this, sr.GetString("Message.OptionDialog.InvalidWindowSize"));
                    return false;
                }

                options.RetainsPassphrase = _retainsPassphrase.Checked;
                options.SSHCheckMAC = _sshCheckMAC.Checked;
                options.CipherAlgorithmOrder = _cipherAlgorithmOrder;
                options.LogSSHEvents = _sshEventLog.Checked;
                agent.EnableKeyAgent = _enableAgentForward.Checked;

                return true;
            }
            catch (Exception ex) {
                GUtil.Warning(this, ex.Message);
                return false;
            }
        }
Пример #7
0
 public void InitUI(IProtocolOptions options, IKeyAgentOptions agent) {
     _cipherOrderList.Items.Clear();
     string[] co = options.CipherAlgorithmOrder;
     foreach (string c in co)
         _cipherOrderList.Items.Add(c);
     _hostKeyBox.SelectedIndex = ParsePublicKeyAlgorithm(options.HostKeyAlgorithmOrder[0]) == PublicKeyAlgorithm.DSA ? 0 : 1; //これはDSA/RSAのどちらかしかない
     _windowSizeBox.Text = options.SSHWindowSize.ToString();
     _retainsPassphrase.Checked = options.RetainsPassphrase;
     _sshCheckMAC.Checked = options.SSHCheckMAC;
     _sshEventLog.Checked = options.LogSSHEvents;
     _cipherAlgorithmOrder = options.CipherAlgorithmOrder;
     _enableAgentForward.Checked = agent.EnableKeyAgent;
 }
Пример #8
0
 public void InitUI(IProtocolOptions options, IKeyAgentOptions agent)
 {
     _cipherOrderList.Items.Clear();
     _cipherOrderList.Items.AddRange(ToCipherAlgorithmListItems(options.CipherAlgorithmOrder));
     _hostKeyAlgorithmOrderList.Items.Clear();
     _hostKeyAlgorithmOrderList.Items.AddRange(ToPublicKeyAlgorithmListItems(options.HostKeyAlgorithmOrder));
     _windowSizeBox.Text = options.SSHWindowSize.ToString();
     _retainsPassphrase.Checked = options.RetainsPassphrase;
     _sshCheckMAC.Checked = options.SSHCheckMAC;
     _sshEventLog.Checked = options.LogSSHEvents;
 }