OpenDDS  Snapshot(2023/04/28-20:55)
Public Types | Public Member Functions | Public Attributes | List of all members
OpenDDS::DCPS::SecurityDebug Class Reference

#include <debug.h>

Public Types

enum  ForceAuthRole { FORCE_AUTH_ROLE_NORMAL, FORCE_AUTH_ROLE_LEADER, FORCE_AUTH_ROLE_FOLLOWER }
 

Public Member Functions

 SecurityDebug ()
 
void set_all_flags_to (bool value)
 Set all security debug message flags to this value. More...
 
void parse_flags (const ACE_TCHAR *flags)
 
void set_debug_level (unsigned level)
 

Public Attributes

bool fake_encryption
 Disable all encryption for security, even the required builtin encryption. More...
 
enum OpenDDS::DCPS::SecurityDebug::ForceAuthRole force_auth_role
 
SecurityFlags

These are the categories of Security Debug Messages

bool encdec_error
 
bool encdec_warn
 
bool encdec_debug
 
bool auth_debug
 Authentication and Handshake. More...
 
bool auth_warn
 
bool new_entity_error
 New entity creating. More...
 
bool new_entity_warn
 
bool cleanup_error
 Cleanup. More...
 
bool access_error
 Permissions and Governance. More...
 
bool access_warn
 
bool bookkeeping
 Generation and Tracking of Crypto Handles and Keys. More...
 
bool showkeys
 Print the Key when Generating it or Using It. More...
 
bool chlookup
 Print Verbose Search Info About Getting the Crypto Handle from a Key id. More...
 

Detailed Description

Global Security Debug Settings

Definition at line 92 of file debug.h.

Member Enumeration Documentation

◆ ForceAuthRole

Force role in authentication handshake. Like fake encryption this will break everything if applied inconsistently.

Enumerator
FORCE_AUTH_ROLE_NORMAL 
FORCE_AUTH_ROLE_LEADER 
FORCE_AUTH_ROLE_FOLLOWER 

Definition at line 152 of file debug.h.

Constructor & Destructor Documentation

◆ SecurityDebug()

OpenDDS::DCPS::SecurityDebug::SecurityDebug ( )

Definition at line 110 of file debug.cpp.

References set_all_flags_to().

111  : fake_encryption(false)
113 {
114  set_all_flags_to(false);
115 }
void set_all_flags_to(bool value)
Set all security debug message flags to this value.
Definition: debug.cpp:117
enum OpenDDS::DCPS::SecurityDebug::ForceAuthRole force_auth_role
bool fake_encryption
Disable all encryption for security, even the required builtin encryption.
Definition: debug.h:146

Member Function Documentation

◆ parse_flags()

void OpenDDS::DCPS::SecurityDebug::parse_flags ( const ACE_TCHAR flags)

Parse a comma delimited string and set the corresponding flags. Unknown ones are ignored and "all" enables all the flags. Ex: "bookkeeping,showkeys"

Definition at line 134 of file debug.cpp.

References access_error, access_warn, ACE_ERROR, ACE_TEXT_ALWAYS_CHAR, auth_debug, auth_warn, bookkeeping, chlookup, cleanup_error, encdec_debug, encdec_error, encdec_warn, LM_WARNING, OpenDDS::DCPS::log_level, new_entity_error, new_entity_warn, set_all_flags_to(), showkeys, and OpenDDS::DCPS::LogLevel::Warning.

Referenced by OpenDDS::DCPS::Service_Participant::load_common_configuration(), and OpenDDS::DCPS::Service_Participant::parse_args().

135 {
136  String s(ACE_TEXT_ALWAYS_CHAR(flags));
137  const String delim(",");
138  while (true) {
139  const size_t pos = s.find(delim);
140  const String flag = s.substr(0, pos);
141  if (flag.length()) {
142  if (flag == "all") {
143  set_all_flags_to(true);
144  } else if (flag == "encdec_error") {
145  encdec_error = true;
146  } else if (flag == "encdec_warn") {
147  encdec_warn = true;
148  } else if (flag == "encdec_debug") {
149  encdec_debug = true;
150  } else if (flag == "auth_debug") {
151  auth_debug = true;
152  } else if (flag == "auth_warn") {
153  auth_warn = true;
154  } else if (flag == "new_entity_error") {
155  new_entity_error = true;
156  } else if (flag == "new_entity_warn") {
157  new_entity_warn = true;
158  } else if (flag == "cleanup_error") {
159  cleanup_error = true;
160  } else if (flag == "access_error") {
161  access_error = true;
162  } else if (flag == "access_warn") {
163  access_warn = true;
164  } else if (flag == "bookkeeping") {
165  bookkeeping = true;
166  } else if (flag == "showkeys") {
167  showkeys = true;
168  } else if (flag == "chlookup") {
169  chlookup = true;
170  } else if (log_level >= LogLevel::Warning) {
171  ACE_ERROR((LM_WARNING, "(%P|%t) WARNING: SecurityDebug::parse_flags: "
172  "Unknown Security Debug Category: \"%C\"\n", flag.c_str()));
173  }
174  }
175  if (pos == String::npos) {
176  break;
177  }
178  s.erase(0, pos + delim.length());
179  }
180 }
void set_all_flags_to(bool value)
Set all security debug message flags to this value.
Definition: debug.cpp:117
#define ACE_ERROR(X)
std::string String
bool chlookup
Print Verbose Search Info About Getting the Crypto Handle from a Key id.
Definition: debug.h:142
#define ACE_TEXT_ALWAYS_CHAR(STRING)
bool auth_debug
Authentication and Handshake.
Definition: debug.h:121
bool cleanup_error
Cleanup.
Definition: debug.h:129
bool access_error
Permissions and Governance.
Definition: debug.h:132
bool bookkeeping
Generation and Tracking of Crypto Handles and Keys.
Definition: debug.h:136
OpenDDS_Dcps_Export LogLevel log_level
bool showkeys
Print the Key when Generating it or Using It.
Definition: debug.h:139
bool new_entity_error
New entity creating.
Definition: debug.h:125

◆ set_all_flags_to()

void OpenDDS::DCPS::SecurityDebug::set_all_flags_to ( bool  value)

Set all security debug message flags to this value.

Definition at line 117 of file debug.cpp.

References access_error, access_warn, auth_debug, auth_warn, bookkeeping, chlookup, cleanup_error, encdec_debug, encdec_error, encdec_warn, new_entity_error, new_entity_warn, showkeys, and value.

Referenced by parse_flags(), and SecurityDebug().

118 {
120  encdec_warn = value;
122  auth_debug = value;
123  auth_warn = value;
128  access_warn = value;
129  bookkeeping = value;
130  showkeys = value;
131  chlookup = value;
132 }
const LogLevel::Value value
Definition: debug.cpp:61
bool chlookup
Print Verbose Search Info About Getting the Crypto Handle from a Key id.
Definition: debug.h:142
bool auth_debug
Authentication and Handshake.
Definition: debug.h:121
bool cleanup_error
Cleanup.
Definition: debug.h:129
bool access_error
Permissions and Governance.
Definition: debug.h:132
bool bookkeeping
Generation and Tracking of Crypto Handles and Keys.
Definition: debug.h:136
bool showkeys
Print the Key when Generating it or Using It.
Definition: debug.h:139
bool new_entity_error
New entity creating.
Definition: debug.h:125

◆ set_debug_level()

void OpenDDS::DCPS::SecurityDebug::set_debug_level ( unsigned  level)

Set debug level similarly to DCPSDebugLevel

Definition at line 182 of file debug.cpp.

References access_error, access_warn, auth_debug, auth_warn, bookkeeping, chlookup, cleanup_error, encdec_debug, encdec_error, encdec_warn, new_entity_error, new_entity_warn, OPENDDS_END_VERSIONED_NAMESPACE_DECL, and showkeys.

Referenced by OpenDDS::DCPS::Service_Participant::load_common_configuration(), and OpenDDS::DCPS::Service_Participant::parse_args().

183 {
185  access_warn = level >= 2;
186  auth_warn = encdec_error = level >= 3;
187  new_entity_warn = level >= 3;
188  auth_debug = encdec_warn = bookkeeping = level >= 4;
189  encdec_debug = level >= 8;
190  showkeys = level >= 9;
191  chlookup = level >= 10;
192 }
bool chlookup
Print Verbose Search Info About Getting the Crypto Handle from a Key id.
Definition: debug.h:142
bool auth_debug
Authentication and Handshake.
Definition: debug.h:121
bool cleanup_error
Cleanup.
Definition: debug.h:129
bool access_error
Permissions and Governance.
Definition: debug.h:132
bool bookkeeping
Generation and Tracking of Crypto Handles and Keys.
Definition: debug.h:136
bool showkeys
Print the Key when Generating it or Using It.
Definition: debug.h:139
bool new_entity_error
New entity creating.
Definition: debug.h:125

Member Data Documentation

◆ access_error

bool OpenDDS::DCPS::SecurityDebug::access_error

◆ access_warn

bool OpenDDS::DCPS::SecurityDebug::access_warn

◆ auth_debug

bool OpenDDS::DCPS::SecurityDebug::auth_debug

Authentication and Handshake.

Definition at line 121 of file debug.h.

Referenced by parse_flags(), set_all_flags_to(), and set_debug_level().

◆ auth_warn

bool OpenDDS::DCPS::SecurityDebug::auth_warn

Encrypting and Decrypting

Definition at line 122 of file debug.h.

Referenced by parse_flags(), set_all_flags_to(), and set_debug_level().

◆ bookkeeping

bool OpenDDS::DCPS::SecurityDebug::bookkeeping

◆ chlookup

bool OpenDDS::DCPS::SecurityDebug::chlookup

Print Verbose Search Info About Getting the Crypto Handle from a Key id.

Definition at line 142 of file debug.h.

Referenced by parse_flags(), OpenDDS::Security::CryptoBuiltInImpl::preprocess_secure_submsg(), set_all_flags_to(), and set_debug_level().

◆ cleanup_error

bool OpenDDS::DCPS::SecurityDebug::cleanup_error

Cleanup.

Definition at line 129 of file debug.h.

Referenced by parse_flags(), set_all_flags_to(), and set_debug_level().

◆ encdec_debug

bool OpenDDS::DCPS::SecurityDebug::encdec_debug

◆ encdec_error

bool OpenDDS::DCPS::SecurityDebug::encdec_error

Encrypting and Decrypting

Definition at line 116 of file debug.h.

Referenced by parse_flags(), set_all_flags_to(), and set_debug_level().

◆ encdec_warn

bool OpenDDS::DCPS::SecurityDebug::encdec_warn

◆ fake_encryption

bool OpenDDS::DCPS::SecurityDebug::fake_encryption

◆ force_auth_role

enum OpenDDS::DCPS::SecurityDebug::ForceAuthRole OpenDDS::DCPS::SecurityDebug::force_auth_role

◆ new_entity_error

bool OpenDDS::DCPS::SecurityDebug::new_entity_error

New entity creating.

Definition at line 125 of file debug.h.

Referenced by parse_flags(), set_all_flags_to(), and set_debug_level().

◆ new_entity_warn

bool OpenDDS::DCPS::SecurityDebug::new_entity_warn

Encrypting and Decrypting

Definition at line 126 of file debug.h.

Referenced by parse_flags(), set_all_flags_to(), and set_debug_level().

◆ showkeys

bool OpenDDS::DCPS::SecurityDebug::showkeys

The documentation for this class was generated from the following files: