Move DhCallback to a separate header.

This commit is contained in:
levlam 2021-07-05 21:20:07 +03:00
parent 61664b4044
commit 040e0deb31
13 changed files with 43 additions and 19 deletions

View File

@ -6,6 +6,7 @@
//
#include "td/utils/benchmark.h"
#include "td/mtproto/DhCallback.h"
#include "td/mtproto/DhHandshake.h"
#include "td/utils/base64.h"

29
td/mtproto/DhCallback.h Normal file
View File

@ -0,0 +1,29 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/utils/Slice.h"
namespace td {
namespace mtproto {
class DhCallback {
public:
DhCallback() = default;
DhCallback(const DhCallback &) = delete;
DhCallback &operator=(const DhCallback &) = delete;
DhCallback(DhCallback &&) = delete;
DhCallback &operator=(DhCallback &&) = delete;
virtual ~DhCallback() = default;
virtual int is_good_prime(Slice prime_str) const = 0;
virtual void add_good_prime(Slice prime_str) const = 0;
virtual void add_bad_prime(Slice prime_str) const = 0;
};
} // namespace mtproto
} // namespace td

View File

@ -6,6 +6,8 @@
//
#include "td/mtproto/DhHandshake.h"
#include "td/mtproto/DhCallback.h"
#include "td/utils/as.h"
#include "td/utils/crypto.h"
#include "td/utils/logging.h"

View File

@ -16,19 +16,7 @@
namespace td {
namespace mtproto {
class DhCallback {
public:
DhCallback() = default;
DhCallback(const DhCallback &) = delete;
DhCallback &operator=(const DhCallback &) = delete;
DhCallback(DhCallback &&) = delete;
DhCallback &operator=(DhCallback &&) = delete;
virtual ~DhCallback() = default;
virtual int is_good_prime(Slice prime_str) const = 0;
virtual void add_good_prime(Slice prime_str) const = 0;
virtual void add_bad_prime(Slice prime_str) const = 0;
};
class DhCallback;
class DhHandshake {
public:

View File

@ -6,6 +6,7 @@
//
#include "td/mtproto/Handshake.h"
#include "td/mtproto/DhHandshake.h"
#include "td/mtproto/KDF.h"
#include "td/mtproto/mtproto_api.h"
#include "td/mtproto/utils.h"

View File

@ -7,7 +7,6 @@
#pragma once
#include "td/mtproto/AuthKey.h"
#include "td/mtproto/DhHandshake.h"
#include "td/mtproto/RSA.h"
#include "td/utils/buffer.h"
@ -24,6 +23,8 @@ class Object;
namespace mtproto {
class DhCallback;
class AuthKeyHandshakeContext {
public:
virtual ~AuthKeyHandshakeContext() = default;

View File

@ -6,7 +6,7 @@
//
#pragma once
#include "td/mtproto/DhHandshake.h"
#include "td/mtproto/DhCallback.h"
#include "td/utils/Slice.h"

View File

@ -19,6 +19,7 @@
#include "td/telegram/UserId.h"
#include "td/mtproto/AuthKey.h"
#include "td/mtproto/DhCallback.h"
#include "td/mtproto/DhHandshake.h"
#include "td/actor/actor.h"

View File

@ -22,7 +22,7 @@
#include "td/telegram/secret_api.h"
#include "td/telegram/telegram_api.hpp"
#include "td/mtproto/DhHandshake.h"
#include "td/mtproto/DhCallback.h"
#include "td/actor/PromiseFuture.h"

View File

@ -114,7 +114,7 @@
#include "td/db/binlog/BinlogEvent.h"
#include "td/mtproto/DhHandshake.h"
#include "td/mtproto/DhCallback.h"
#include "td/mtproto/Handshake.h"
#include "td/mtproto/HandshakeActor.h"
#include "td/mtproto/RawConnection.h"

View File

@ -20,7 +20,7 @@
#include "td/telegram/StateManager.h"
#include "td/telegram/UniqueId.h"
#include "td/mtproto/DhHandshake.h"
#include "td/mtproto/DhCallback.h"
#include "td/mtproto/Handshake.h"
#include "td/mtproto/HandshakeActor.h"
#include "td/mtproto/RawConnection.h"

View File

@ -11,6 +11,7 @@
#include "td/telegram/NotificationManager.h"
#include "td/mtproto/AuthData.h"
#include "td/mtproto/DhCallback.h"
#include "td/mtproto/DhHandshake.h"
#include "td/mtproto/Handshake.h"
#include "td/mtproto/HandshakeActor.h"

View File

@ -22,7 +22,7 @@
#include "td/db/BinlogKeyValue.h"
#include "td/db/DbKey.h"
#include "td/mtproto/DhHandshake.h"
#include "td/mtproto/DhCallback.h"
#include "td/mtproto/utils.h"
#include "td/tl/tl_object_parse.h"