curve_server.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MPL-2.0 */
2 
3 #ifndef __ZMQ_CURVE_SERVER_HPP_INCLUDED__
4 #define __ZMQ_CURVE_SERVER_HPP_INCLUDED__
5 
6 #ifdef ZMQ_HAVE_CURVE
7 
9 #include "options.hpp"
10 #include "zap_client.hpp"
11 
12 namespace zmq
13 {
14 #ifdef _MSC_VER
15 #pragma warning(push)
16 #pragma warning(disable : 4250)
17 #endif
18 class curve_server_t ZMQ_FINAL : public zap_client_common_handshake_t,
19  public curve_mechanism_base_t
20 {
21  public:
22  curve_server_t (session_base_t *session_,
23  const std::string &peer_address_,
24  const options_t &options_,
25  const bool downgrade_sub_);
26  ~curve_server_t ();
27 
28  // mechanism implementation
29  int next_handshake_command (msg_t *msg_);
30  int process_handshake_command (msg_t *msg_);
31  int encode (msg_t *msg_);
32  int decode (msg_t *msg_);
33 
34  private:
35  // Our secret key (s)
36  uint8_t _secret_key[crypto_box_SECRETKEYBYTES];
37 
38  // Our short-term public key (S')
39  uint8_t _cn_public[crypto_box_PUBLICKEYBYTES];
40 
41  // Our short-term secret key (s')
42  uint8_t _cn_secret[crypto_box_SECRETKEYBYTES];
43 
44  // Client's short-term public key (C')
45  uint8_t _cn_client[crypto_box_PUBLICKEYBYTES];
46 
47  // Key used to produce cookie
48  uint8_t _cookie_key[crypto_secretbox_KEYBYTES];
49 
50  int process_hello (msg_t *msg_);
51  int produce_welcome (msg_t *msg_);
52  int process_initiate (msg_t *msg_);
53  int produce_ready (msg_t *msg_);
54  int produce_error (msg_t *msg_) const;
55 
56  void send_zap_request (const uint8_t *key_);
57 };
58 #ifdef _MSC_VER
59 #pragma warning(pop)
60 #endif
61 }
62 
63 #endif
64 
65 #endif
curve_mechanism_base.hpp
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
zmq
Definition: zmq.hpp:229
zap_client.hpp
options.hpp
ZMQ_FINAL
Definition: unittest_ip_resolver.cpp:26
options_
DebugStringOptions options_
Definition: src/google/protobuf/descriptor.cc:2410


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:49