1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
33 #ifndef SSHKEYEXCHANGE_P_H
34 #define SSHKEYEXCHANGE_P_H
38 #include <QtCore/QByteArray>
39 #include <QtCore/QScopedPointer>
41 namespace Botan { class HashFunction; }
46 class SshSendFacility;
47 class SshIncomingPacket;
52 SshKeyExchange(SshSendFacility &sendFacility);
55 void sendKexInitPacket(const QByteArray &serverId);
57 // Returns true <=> the server sends a guessed package.
58 bool sendDhInitPacket(const SshIncomingPacket &serverKexInit);
60 void sendNewKeysPacket(const SshIncomingPacket &dhReply,
61 const QByteArray &clientId);
63 QByteArray k() const { return m_k; }
64 QByteArray h() const { return m_h; }
65 Botan::HashFunction *hash() const { return m_hash.data(); }
66 QByteArray encryptionAlgo() const { return m_encryptionAlgo; }
67 QByteArray decryptionAlgo() const { return m_decryptionAlgo; }
68 QByteArray hMacAlgoClientToServer() const { return m_c2sHMacAlgo; }
69 QByteArray hMacAlgoServerToClient() const { return m_s2cHMacAlgo; }
72 QByteArray m_serverId;
73 QByteArray m_clientKexInitPayload;
74 QByteArray m_serverKexInitPayload;
75 QScopedPointer<Botan::DH_PrivateKey> m_dhKey;
78 QByteArray m_serverHostKeyAlgo;
79 QByteArray m_encryptionAlgo;
80 QByteArray m_decryptionAlgo;
81 QByteArray m_c2sHMacAlgo;
82 QByteArray m_s2cHMacAlgo;
83 QScopedPointer<Botan::HashFunction> m_hash;
84 SshSendFacility &m_sendFacility;
87 } // namespace Internal
90 #endif // SSHKEYEXCHANGE_P_H