1/*
2 This file is part of Mtproto-proxy Library.
3
4 Mtproto-proxy Library is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 Mtproto-proxy Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with Mtproto-proxy Library. If not, see <http://www.gnu.org/licenses/>.
16
17 Copyright 2014-2016 Telegram Messenger Inc
18 2014-2016 Nikolai Durov
19*/
20
21#pragma once
22
23#include "net/net-crypto-aes.h"
24
25#define MAX_PWD_CONFIG_LEN 16384
26
27#define RPCF_ALLOW_UNENC 1
28#define RPCF_ALLOW_ENC 2
29#define RPCF_REQ_DH 4
30#define RPCF_ALLOW_SKIP_DH 8
31#define RPCF_DISABLE_RPC 0x1000
32#define RPCF_ALLOW_MC 0x2000
33#define RPCF_ALLOW_SQL 0x4000
34#define RPCF_ALLOW_HTTP 0x8000
35#define RPCF_RESULT_VALID 0x80000000
36
37extern char pwd_config_buf[MAX_PWD_CONFIG_LEN + 128];
38extern int pwd_config_len;
39extern char pwd_config_md5[33];
40
41int select_best_key_signature (int key_signature, int extra_num, const int *extra_key_signatures);
42