irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_client_negotiation.cpp
Go to the documentation of this file.
1 // =-=-=-=-=-=-=-
2 #include <cstdlib>
4 #include "irods_stacktrace.hpp"
5 #include "irods_exception.hpp"
11 #include "MD5Strategy.hpp"
12 #include "sockComm.h"
14 
15 // =-=-=-=-=-=-=-
16 // irods includes
17 #include "rsGlobalExtern.hpp"
18 #include "rodsDef.h"
19 #include "rodsConnect.h"
20 #include "rcMisc.h"
21 //#include "index.hpp"
22 //#include "reFuncDefs.hpp"
23 
24 // =-=-=-=-=-=-=-
25 // stl includes
26 #include <map>
27 #include <vector>
28 
29 extern const packInstruct_t RodsPackTable[];
30 
31 namespace irods {
34  const std::string& determine_negotiation_key( const std::string& _host_name ) {
35  // search the federation map for the host name
36  try {
37  for ( const auto& el : irods::get_server_property<const std::vector<boost::any>>(irods::CFG_FEDERATION_KW) ) {
38  try {
39  const auto& federation = boost::any_cast<const std::unordered_map<std::string, boost::any>&>(el);
40  try {
41  if ( _host_name == boost::any_cast<const std::string&>(boost::any_cast<const std::vector<boost::any>&>(federation.at(irods::CFG_CATALOG_PROVIDER_HOSTS_KW))[0]) ) {
42  return boost::any_cast<const std::string&>(federation.at(irods::CFG_NEGOTIATION_KEY_KW));
43  }
44  } catch ( const boost::bad_any_cast& ) {
45  rodsLog(
46  LOG_ERROR,
47  "%s - failed to cast federation entry to string",
48  __PRETTY_FUNCTION__);
49  continue;
50  } catch ( const std::out_of_range& ) {
51  rodsLog(
52  LOG_ERROR,
53  "%s - federation object did not contain required keys",
54  __PRETTY_FUNCTION__);
55  continue;
56  }
57  } catch ( const boost::bad_any_cast& ) {
58  rodsLog(
59  LOG_ERROR,
60  "%s - failed to cast array member to federation object",
61  __PRETTY_FUNCTION__);
62  continue;
63  }
64 
65  } // for i
66 
67  } catch ( const irods::exception& ) {}
68 
69  // if not, it must be in our zone
70  return irods::get_server_property<const std::string>(CFG_NEGOTIATION_KEY_KW);
71 
72  } // determine_negotiation_key
73 
77  const std::string _svr_sid,
78  const std::string _enc_key,
79  std::string& _signed_sid ) {
80  // =-=-=-=-=-=-=-
81  // create an encryption object
82  // 32 byte key, 8 byte iv, 16 rounds encryption
83  irods::buffer_crypt crypt;
85 
86  // leverage iteration to copy from std::string to a std::vector<>
87  key.assign( _enc_key.begin(), _enc_key.end() );
88 
90  // leverage iteration to copy from std::string to a std::vector<>
91  in_buf.assign( _svr_sid.begin(), _svr_sid.end() );
92 
94  irods::error err = crypt.encrypt(
95  key,
96  key, // reuse key as iv
97  in_buf,
98  out_buf );
99  if ( !err.ok() ) {
100  return PASS( err );
101  }
102 
103  // =-=-=-=-=-=-=-
104  // hash the encrypted sid
105  Hasher hasher;
106  err = getHasher( MD5_NAME, hasher );
107  hasher.update( std::string( reinterpret_cast<char*>( out_buf.data() ), out_buf.size() ) );
108  hasher.digest( _signed_sid );
109 
110  return SUCCESS();
111 
112  } // sign_server_sid
113 
117  typedef std::map < std::string, int > negotiation_map_t;
118  typedef std::pair< std::string, int > negotiation_pair_t;
119  public:
121  // =-=-=-=-=-=-=-
122  // initialize the negotiation context
126 
127  // =-=-=-=-=-=-=-
128  // table is indexed as[ CLIENT ][ SERVER ]
129  client_server_negotiations_table[ 0 ][ 0 ] = CS_NEG_USE_SSL; // REQ, REQ
130  client_server_negotiations_table[ 0 ][ 1 ] = CS_NEG_USE_SSL; // REQ, DC
131  client_server_negotiations_table[ 0 ][ 2 ] = CS_NEG_FAILURE; // REQ, REF
132  client_server_negotiations_table[ 1 ][ 0 ] = CS_NEG_USE_SSL; // DC, REQ
133  client_server_negotiations_table[ 1 ][ 1 ] = CS_NEG_USE_SSL; // DC, DC
134  client_server_negotiations_table[ 1 ][ 2 ] = CS_NEG_USE_TCP; // DC, REF
135  client_server_negotiations_table[ 2 ][ 0 ] = CS_NEG_FAILURE; // REF, REQ
136  client_server_negotiations_table[ 2 ][ 1 ] = CS_NEG_USE_TCP; // REF, DC
137  client_server_negotiations_table[ 2 ][ 2 ] = CS_NEG_USE_TCP; // REF, REF
138 
139  } // ctor
140 
142  const std::string& _cli_policy,
143  const std::string& _svr_policy,
144  std::string& _result ) {
145  // =-=-=-=-=-=-=-
146  // convert client policy to an index
147  // in order to reference the negotiation table
148  int cli_idx = cs_neg_param_map[ _cli_policy ];
149  if ( cli_idx > 2 || cli_idx < 0 ) {
151  "client policy index is out of bounds" );
152 
153  }
154 
155  // =-=-=-=-=-=-=-
156  // convert server policy to an index
157  // in order to reference the negotiation table
158  int svr_idx = cs_neg_param_map[ _svr_policy ];
159  if ( svr_idx > 2 || svr_idx < 0 ) {
161  "server policy index is out of bounds" );
162 
163  }
164 
165  // =-=-=-=-=-=-=-
166  // politely ask for the SSL usage results
167  _result = client_server_negotiations_table[ cli_idx ][ svr_idx ];
168 
169  return SUCCESS();
170 
171  } // operator()
172 
173  private:
177 
181 
182  }; // class client_server_negotiations_context
183 
188  // =-=-=-=-=-=-=-
189  // get the irods environment so we can compare the
190  // flag for negotiation of policy
191  rodsEnv rods_env;
192  int status = getRodsEnv( &rods_env );
193  if ( status < 0 ) {
194  return false;
195  }
196 
197  // =-=-=-=-=-=-=-
198  // if it is not set then move on
199  std::string neg_policy( rods_env.rodsClientServerNegotiation );
200  if ( neg_policy.empty() ) {
201  return false;
202  }
203 
204  // =-=-=-=-=-=-=-
205  // if it is set then check for our magic token which requests
206  // the negotiation, if its not there then return success
207  if ( std::string::npos == neg_policy.find( REQ_SVR_NEG ) ) {
208  return false;
209  }
210 
211  // =-=-=-=-=-=-=-
212  // otherwise, its a failure.
213  return true;
214 
215  } // do_client_server_negotiation_for_client
216 
221  // =-=-=-=-=-=-=-
222  // check the SP_OPTION for the string stating a negotiation is requested
223  char* opt_ptr = getenv( RODS_CS_NEG );
224 
225  // =-=-=-=-=-=-=-
226  // if it is not set then move on
227  if ( !opt_ptr || strlen( opt_ptr ) == 0 ) {
228  return false;
229  }
230 
231  // =-=-=-=-=-=-=-
232  // if it is set then check for our magic token which requests
233  // the negotiation, if its not there then return success
234  std::string opt_str( opt_ptr );
235  if ( std::string::npos == opt_str.find( REQ_SVR_NEG ) ) {
236  return false;
237  }
238 
239  // =-=-=-=-=-=-=-
240  // otherwise, its a go.
241  return true;
242 
243  } // do_client_server_negotiation_for_server
244 
249  const std::string& _host_name,
250  std::string& _result ) {
251 
252  // =-=-=-=-=-=-=-
253  // we requested a negotiation, wait for the response from CS_NEG_SVR_1_MSG
254  boost::shared_ptr< cs_neg_t > cs_neg;
255  error err = read_client_server_negotiation_message( _ptr, cs_neg );
256  if ( !err.ok() ) {
257  return PASS( err );
258  }
259 
260  // =-=-=-=-=-=-=-
261  // get the server requested policy
262  std::string svr_policy( cs_neg->result_ );
263  if ( svr_policy.empty() || cs_neg->status_ != CS_NEG_STATUS_SUCCESS ) {
264  std::stringstream msg;
265  msg << "invalid result [" << cs_neg->result_ << "] or status: " << cs_neg->status_;
266  return ERROR(
268  msg.str() );
269  }
270 
271  // =-=-=-=-=-=-=-
272  // get the irods environment so we can compare the
273  // policy in the irods_environment.json file
274  rodsEnv rods_env;
275  int status = getRodsEnv( &rods_env );
276  if ( status < 0 ) {
277  return ERROR( status, "failed in getRodsEnv" );
278  }
279 
280  // =-=-=-=-=-=-=-
281  // if the policy is empty, then default to DONT_CARE
282  std::string cli_policy( rods_env.rodsClientServerPolicy );
283  if ( cli_policy.empty() ) {
284  cli_policy = CS_NEG_DONT_CARE;
285 
286  }
287 
288  // =-=-=-=-=-=-=-
289  // perform the negotiation
291  std::string result;
292  error neg_err = negotiate( cli_policy, svr_policy, result );
293 
294  // =-=-=-=-=-=-=-
295  // aggregate the error stack if necessary
296  error ret = SUCCESS();
297  if ( !neg_err.ok() ) {
298  ret = PASSMSG( "failed in negotiation context", neg_err );
299  }
300 
301  // =-=-=-=-=-=-=-
302  // handle failure - send a failure msg back to client
303  if ( !err.ok() || CS_NEG_FAILURE == result ) {
304  // =-=-=-=-=-=-=-
305  // send CS_NEG_CLI_1_MSG, failure message to the server
306  cs_neg_t send_cs_neg;
307  send_cs_neg.status_ = CS_NEG_STATUS_FAILURE;
308  snprintf( send_cs_neg.result_, sizeof( send_cs_neg.result_ ),
309  "%s", CS_NEG_FAILURE.c_str() );
311  _ptr,
312  send_cs_neg );
313  if ( !send_err.ok() ) {
314  ret = PASSMSG( "failed to send CS_NEG_CLI1_MSG Failure Messsage", send_err );
315  }
316 
317  std::stringstream msg;
318  msg << "client-server negoations failed for server request [";
319  msg << svr_policy << "] and client request [" << cli_policy << "]";
320  ret = ERROR(
322  msg.str() );
323  return ret;
324  }
325 
326  // =-=-=-=-=-=-=-
327  // attempt to get the server config, if we can then we must be an
328  // Agent. sign the SID and send it showing that we are a trusted
329  // Agent and not an actual Client ( icommand, jargon connection etc )
330  std::string cli_msg;
331 
332  // =-=-=-=-=-=-=-
333  // if we cannot read a server config file, punt
334  // as this must be a client-side situation
335  bool client_side = false;
336  try {
338  } catch ( const irods::exception& e ) {
339  client_side = true;
340  }
341  if ( !client_side ) {
342  // =-=-=-=-=-=-=-
343  // get our local zone SID
344  boost::optional<const std::string&> sid;
345  try {
346  try {
347  sid.reset(irods::get_server_property<const std::string>(irods::CFG_ZONE_KEY_KW));
348  } catch ( const irods::exception e ) {
349  sid.reset(irods::get_server_property<const std::string>(LOCAL_ZONE_SID_KW));
350  }
351  try {
352  const std::string& neg_key = determine_negotiation_key(_host_name);
353  // =-=-=-=-=-=-=-
354  // sign the SID
355  std::string signed_sid;
356  err = sign_server_sid(
357  *sid,
358  neg_key,
359  signed_sid );
360  if ( err.ok() ) {
361  // =-=-=-=-=-=-=-
362  // add the SID to the returning client message
363  cli_msg += CS_NEG_SID_KW +
365  signed_sid +
367  }
368  else {
369  rodsLog(
370  LOG_WARNING,
371  "%s",
372  PASS( err ).result().c_str() );
373  }
374  } catch( const irods::exception& ) {
375  rodsLog(LOG_WARNING, "failed to get agent key");
376  }
377  } catch ( const irods::exception e ) {
378  rodsLog(LOG_WARNING, "failed to get local zone SID");
379  }
380  }
381 
382  // =-=-=-=-=-=-=-
383  // tack on the rest of the result
384  cli_msg += CS_NEG_RESULT_KW +
386  result +
388 
389  // =-=-=-=-=-=-=-
390  // send CS_NEG_CLI_1_MSG, success message to the server with our choice
391  cs_neg_t send_cs_neg;
392  send_cs_neg.status_ = CS_NEG_STATUS_SUCCESS;
393  snprintf( send_cs_neg.result_, sizeof( send_cs_neg.result_ ), "%s", cli_msg.c_str() );
395  _ptr,
396  send_cs_neg );
397  if ( !err.ok() ) {
398  return PASSMSG( "failed to send CS_NEG_CLI_1_MSG Success Message", err );
399  }
400 
401  // =-=-=-=-=-=-=-
402  // set the out variable and return
403  _result = result;
404 
405  return SUCCESS();
406 
407  } // client_server_negotiation_for_client
408 
413  cs_neg_t& _cs_neg_msg ) {
414  // =-=-=-=-=-=-=-
415  // pack the negotiation message
416  bytesBuf_t* cs_neg_buf = 0;
417  int status = packStruct( &_cs_neg_msg,
418  &cs_neg_buf,
419  "CS_NEG_PI",
421  0, XML_PROT );
422  if ( status < 0 ) {
423  return ERROR( status, "failed to pack client-server message" );
424  }
425 
426  // =-=-=-=-=-=-=-
427  // pack the negotiation message
428  irods::error ret = sendRodsMsg( _ptr,
430  cs_neg_buf,
431  0, 0, 0,
432  XML_PROT );
433  freeBBuf( cs_neg_buf );
434  if ( !ret.ok() ) {
435  return PASSMSG( "failed to send client-server negotiation message", ret );
436 
437  }
438 
439  return SUCCESS();
440 
441  } // send_client_server_negotiation_message
442 
447  boost::shared_ptr< cs_neg_t >& _cs_neg_msg ) {
448  // =-=-=-=-=-=-=-
449  // read the message header
450  struct timeval tv;
451  tv.tv_sec = READ_VERSION_TOUT_SEC;
452  tv.tv_usec = 0;
453 
454  msgHeader_t msg_header;
455  irods::error ret = readMsgHeader( _ptr, &msg_header, &tv );
456  if ( !ret.ok() ) {
457  return PASSMSG( "read message header failed", ret );
458  }
459 
460  // =-=-=-=-=-=-=-
461  // read the message body
462  bytesBuf_t struct_buf, data_buf, error_buf;
463  memset( &data_buf, 0, sizeof( bytesBuf_t ) );
464  ret = readMsgBody(
465  _ptr,
466  &msg_header,
467  &struct_buf,
468  &data_buf,
469  &error_buf,
470  XML_PROT, 0 );
471  if ( !ret.ok() ) {
472  return PASS( ret );
473 
474  }
475 
476  // =-=-=-=-=-=-=-
477  // check that we did in fact get the right type of message
478  if ( strcmp( msg_header.type, RODS_CS_NEG_T ) != 0 ) {
479  // =-=-=-=-=-=-=-
480  // trap potential case where server does not support
481  // advanced negotiation. a version msg would be sent
482  // back instead.
483  if ( strcmp( msg_header.type, RODS_VERSION_T ) == 0 ) {
484  // =-=-=-=-=-=-=-
485  // unpack the version struct to check the status
486  version_t* version = 0;
487  int status = unpackStruct(
488  struct_buf.buf,
489  ( void ** )( static_cast<void *>( &version ) ),
490  "Version_PI",
492  XML_PROT );
493 
494  if ( struct_buf.buf ) {
495  free( struct_buf.buf );
496  }
497  if ( data_buf.buf ) {
498  free( data_buf.buf );
499  }
500  if ( error_buf.buf ) {
501  free( error_buf.buf );
502  }
503 
504  if ( status < 0 ) {
505  rodsLog( LOG_ERROR, "read_client_server_negotiation_message :: unpackStruct FAILED" );
506  return ERROR( status, "unpackStruct failed" );
507 
508  }
509 
510  if ( version->status < 0 ) {
511  rodsLog( LOG_ERROR, "read_client_server_negotiation_message :: received error message %d", version->status );
512  return ERROR( version->status, "negotiation failed" );
513 
514  }
515  else {
516  // =-=-=-=-=-=-=-
517  // if no negoation is allowed then provide a readable
518  // error for the client
519  std::stringstream msg;
520  msg << "received [" << msg_header.type << "] ";
521  msg << "but expected [" << RODS_CS_NEG_T << "]\n\n";
522  msg << "\t*** Advanced negotiation is enabled in this iRODS environment ***\n";
523  msg << "\t*** which is most likely not supported by the server. ***\n";
524  msg << "\t*** Comment out irods_client_server_negotiation in the ***\n";
525  msg << "\t*** irods_environment.json file to disable. ***\n";
526  return ERROR( ADVANCED_NEGOTIATION_NOT_SUPPORTED, msg.str() );
527  }
528 
529  }
530  else {
531  // =-=-=-=-=-=-=-
532  // something entirely unexpected happened
533  std::stringstream msg;
534  msg << "wrong message type [" << msg_header.type << "] ";
535  msg << "expected [" << RODS_CS_NEG_T << "]";
536  return ERROR( SYS_HEADER_TYPE_LEN_ERR, msg.str() );
537  }
538  }
539 
540  // =-=-=-=-=-=-=-
541  // check that we did not get any data with the message
542  if ( msg_header.bsLen != 0 ) {
543  if ( data_buf.buf != NULL ) {
544  free( data_buf.buf );
545  }
547  "read_client_server_negotiation_message: msg_header.bsLen = %d is not 0",
548  msg_header.bsLen );
549  }
550 
551  // =-=-=-=-=-=-=-
552  // check that we did not get anything in the error buffer
553  if ( msg_header.errorLen != 0 ) {
554  if ( error_buf.buf ) {
555  free( error_buf.buf );
556  }
558  "read_client_server_negotiation_message: msg_header.errorLen = %d is not 0",
559  msg_header.errorLen );
560  }
561 
562  // =-=-=-=-=-=-=-
563  // check that we did get an appropriately sized message
564  if ( msg_header.msgLen > ( int ) sizeof( irods::cs_neg_t ) * 2 ||
565  msg_header.msgLen <= 0 ) {
566  if ( struct_buf.buf != NULL ) {
567  free( struct_buf.buf );
568  }
569  std::stringstream msg;
570  msg << "message length is invalid: " << msg_header.msgLen << " vs " << sizeof( irods::cs_neg_t );
571  return ERROR( SYS_HEADER_READ_LEN_ERR, msg.str() );
572  }
573 
574  // =-=-=-=-=-=-=-
575  // do an unpack into our out variable using the xml protocol
576  cs_neg_t* tmp_cs_neg = 0;
577  int status = unpackStruct( struct_buf.buf,
578  ( void ** )( static_cast<void *>( &tmp_cs_neg ) ),
579  "CS_NEG_PI",
581  XML_PROT );
582  free( struct_buf.buf );
583  if ( status < 0 ) {
584  rodsLog( LOG_ERROR, "read_client_server_negotiation_message :: unpackStruct FAILED" );
585  return ERROR( status, "unpackStruct failed" );
586 
587  }
588 
589  _cs_neg_msg.reset( tmp_cs_neg, free );
590 
591  // =-=-=-=-=-=-=-
592  // win!!!111one
593  return SUCCESS();
594 
595  } // read_client_server_negotiation_message
596 
597 }; // namespace irods
598 
599 
600 
601 
602 
603 
604 
605 
606 
607 
608 
609 
610 
611 
612 
613 
614 
615 
616 
617 
618 
619 
620 
621 
622 
623 
624 
625 
626 
627 
628 
629 
630 
631 
632 
633 
634 
635 
636 
637 
638 
msgHeader::errorLen
int errorLen
Definition: rodsDef.h:213
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
msgHeader::bsLen
int bsLen
Definition: rodsDef.h:214
NULL
#define NULL
Definition: rodsDef.h:70
irods::get_server_property
T & get_server_property(const std::string &_prop)
Definition: irods_server_properties.hpp:118
CLIENT_NEGOTIATION_ERROR
@ CLIENT_NEGOTIATION_ERROR
Definition: rodsErrorTable.h:773
irods::CS_NEG_FAILURE
const std::string CS_NEG_FAILURE("CS_NEG_FAILURE")
irods::client_server_negotiations_context::negotiation_map_t
std::map< std::string, int > negotiation_map_t
Definition: irods_client_negotiation.cpp:117
msgHeader
Definition: rodsDef.h:210
RODS_CS_NEG_T
#define RODS_CS_NEG_T
Definition: rodsDef.h:231
getRodsEnv
int getRodsEnv(rodsEnv *myRodsEnv)
Definition: getRodsEnv.cpp:112
irods::buffer_crypt::array_t
std::vector< unsigned char > array_t
Definition: irods_buffer_encryption.hpp:30
irods_server_properties.hpp
readMsgBody
irods::error readMsgBody(irods::network_object_ptr, msgHeader_t *, bytesBuf_t *, bytesBuf_t *, bytesBuf_t *, irodsProt_t, struct timeval *)
Definition: sockComm.cpp:236
irods::CFG_FEDERATION_KW
const std::string CFG_FEDERATION_KW("federation")
irods::CS_NEG_STATUS_SUCCESS
const int CS_NEG_STATUS_SUCCESS
Definition: irods_client_server_negotiation.hpp:29
BytesBuf::buf
void * buf
Definition: rodsDef.h:199
irods::CFG_CATALOG_PROVIDER_HOSTS_KW
const std::string CFG_CATALOG_PROVIDER_HOSTS_KW("catalog_provider_hosts")
packInstruct_t
Definition: packStruct.h:31
rodsEnv::rodsClientServerPolicy
char rodsClientServerPolicy[256]
Definition: getRodsEnv.h:22
irods::CS_NEG_SID_KW
const std::string CS_NEG_SID_KW("cs_neg_sid_kw")
irods::CS_NEG_USE_TCP
const std::string CS_NEG_USE_TCP("CS_NEG_USE_TCP")
irods_stacktrace.hpp
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
msgHeader::type
char type[128]
Definition: rodsDef.h:211
irods::cs_neg_t::result_
char result_[(1024+64)]
Definition: irods_client_server_negotiation.hpp:36
irods::cs_neg_t
Definition: irods_client_server_negotiation.hpp:34
ADVANCED_NEGOTIATION_NOT_SUPPORTED
@ ADVANCED_NEGOTIATION_NOT_SUPPORTED
Definition: rodsErrorTable.h:764
LOG_WARNING
#define LOG_WARNING
Definition: rodsLog.h:38
irods::client_server_negotiations_context
Definition: irods_client_negotiation.cpp:116
irods::determine_negotiation_key
const std::string & determine_negotiation_key(const std::string &_host_name)
Definition: irods_client_negotiation.cpp:34
irods_exception.hpp
irods::CFG_ZONE_KEY_KW
const std::string CFG_ZONE_KEY_KW("zone_key")
XML_PROT
@ XML_PROT
Definition: rodsDef.h:149
rcMisc.h
irods::getHasher
error getHasher(const std::string &name, Hasher &hasher)
Definition: irods_hasher_factory.cpp:27
irods::do_client_server_negotiation_for_server
bool do_client_server_negotiation_for_server()
Definition: irods_client_negotiation.cpp:220
irods::kvp_delimiter
std::string kvp_delimiter()
Definition: irods_kvp_string_parser.cpp:17
irods.pypyodbc.version
string version
Definition: pypyodbc.py:28
unpackStruct
int unpackStruct(const void *inPackStr, void **outStruct, const char *packInstName, const packInstruct_t *myPackTable, irodsProt_t irodsProt)
Definition: packStruct.cpp:63
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
readMsgHeader
irods::error readMsgHeader(irods::network_object_ptr, msgHeader_t *, struct timeval *)
Definition: sockComm.cpp:173
RODS_VERSION_T
#define RODS_VERSION_T
Definition: rodsDef.h:225
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
rodsConnect.h
SYS_HEADER_TYPE_LEN_ERR
@ SYS_HEADER_TYPE_LEN_ERR
Definition: rodsErrorTable.h:74
irods::CFG_NEGOTIATION_KEY_KW
const std::string CFG_NEGOTIATION_KEY_KW("negotiation_key")
irods::send_client_server_negotiation_message
error send_client_server_negotiation_message(irods::network_object_ptr, cs_neg_t &)
Definition: irods_client_negotiation.cpp:411
msgHeader::msgLen
int msgLen
Definition: rodsDef.h:212
irods::client_server_negotiations_context::client_server_negotiations_table
std::string client_server_negotiations_table[3][3]
Definition: irods_client_negotiation.cpp:176
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
SYS_HEADER_READ_LEN_ERR
@ SYS_HEADER_READ_LEN_ERR
Definition: rodsErrorTable.h:72
rsGlobalExtern.hpp
irods::cs_neg_t::status_
int status_
Definition: irods_client_server_negotiation.hpp:35
irods::sign_server_sid
error sign_server_sid(const std::string, const std::string, std::string &)
Definition: irods_client_negotiation.cpp:76
irods_buffer_encryption.hpp
irods::read_client_server_negotiation_message
error read_client_server_negotiation_message(irods::network_object_ptr, boost::shared_ptr< cs_neg_t > &)
Definition: irods_client_negotiation.cpp:445
irods::CS_NEG_DONT_CARE
const std::string CS_NEG_DONT_CARE("CS_NEG_DONT_CARE")
irods
Definition: apiHandler.hpp:35
rodsDef.h
irods::CS_NEG_USE_SSL
const std::string CS_NEG_USE_SSL("CS_NEG_USE_SSL")
irods::client_server_negotiations_context::negotiation_pair_t
std::pair< std::string, int > negotiation_pair_t
Definition: irods_client_negotiation.cpp:118
irods::Hasher
Definition: Hasher.hpp:15
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
irods::buffer_crypt
Definition: irods_buffer_encryption.hpp:25
irods::client_server_negotiations_context::operator()
error operator()(const std::string &_cli_policy, const std::string &_svr_policy, std::string &_result)
Definition: irods_client_negotiation.cpp:141
irods::client_server_negotiations_context::cs_neg_param_map
negotiation_map_t cs_neg_param_map
Definition: irods_client_negotiation.cpp:180
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
sendRodsMsg
irods::error sendRodsMsg(irods::network_object_ptr, const char *, bytesBuf_t *, bytesBuf_t *, bytesBuf_t *, int, irodsProt_t)
Definition: sockComm.cpp:1221
irods::buffer_crypt::encrypt
irods::error encrypt(const array_t &, const array_t &, const array_t &, array_t &)
Definition: irods_buffer_encryption.cpp:168
irods::Hasher::update
error update(const std::string &)
Definition: Hasher.cpp:22
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
BytesBuf
Definition: rodsDef.h:197
irods::error
Definition: irods_error.hpp:23
rodsEnv::rodsClientServerNegotiation
char rodsClientServerNegotiation[256]
Definition: getRodsEnv.h:23
irods::do_client_server_negotiation_for_client
bool do_client_server_negotiation_for_client()
Definition: irods_client_negotiation.cpp:187
irods::CS_NEG_REQUIRE
const std::string CS_NEG_REQUIRE("CS_NEG_REQUIRE")
RodsPackTable
const packInstruct_t RodsPackTable[]
Definition: rodsPackTable.h:61
irods::server_properties::instance
static server_properties & instance()
Definition: irods_server_properties.cpp:30
irods::Hasher::digest
error digest(std::string &messageDigest)
Definition: Hasher.cpp:35
irods::network_object_ptr
boost::shared_ptr< network_object > network_object_ptr
Definition: irods_network_object.hpp:78
LOCAL_ZONE_SID_KW
#define LOCAL_ZONE_SID_KW
Definition: rodsConnect.h:84
irods::RODS_CS_NEG
const char RODS_CS_NEG[]
Definition: irods_client_server_negotiation.hpp:24
irods_hasher_factory.hpp
packStruct
int packStruct(const void *inStruct, bytesBuf_t **packedResult, const char *packInstName, const packInstruct_t *myPackTable, int packFlag, irodsProt_t irodsProt)
Definition: packStruct.cpp:21
irods_kvp_string_parser.hpp
irods::exception
Definition: irods_exception.hpp:15
irods::kvp_association
std::string kvp_association()
Definition: irods_kvp_string_parser.cpp:23
irods::client_server_negotiations_context::client_server_negotiations_context
client_server_negotiations_context()
Definition: irods_client_negotiation.cpp:120
irods_configuration_parser.hpp
sockComm.h
irods::client_server_negotiation_for_client
error client_server_negotiation_for_client(irods::network_object_ptr, const std::string &, std::string &)
Definition: irods_client_negotiation.cpp:247
irods::MD5_NAME
const std::string MD5_NAME("md5")
irods::CS_NEG_RESULT_KW
const std::string CS_NEG_RESULT_KW("cs_neg_result_kw")
REQ_SVR_NEG
#define REQ_SVR_NEG
Definition: rodsDef.h:272
freeBBuf
int freeBBuf(bytesBuf_t *myBBuf)
Definition: rcMisc.cpp:88
version_t
Definition: rodsDef.h:286
irods::CS_NEG_REFUSE
const std::string CS_NEG_REFUSE("CS_NEG_REFUSE")
irods::CS_NEG_STATUS_FAILURE
const int CS_NEG_STATUS_FAILURE
Definition: irods_client_server_negotiation.hpp:30
rodsEnv
Definition: getRodsEnv.h:8
sockCommNetworkInterface.hpp
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
READ_VERSION_TOUT_SEC
#define READ_VERSION_TOUT_SEC
Definition: sockComm.h:25
irods_client_server_negotiation.hpp
MD5Strategy.hpp