testing_policy.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #ifndef OPEN62541_TESTING_POLICY_H
  5. #define OPEN62541_TESTING_POLICY_H
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. #include "ua_plugin_securitypolicy.h"
  10. #include "ua_plugin_log.h"
  11. typedef struct funcs_called {
  12. UA_Boolean asym_enc;
  13. UA_Boolean asym_dec;
  14. UA_Boolean sym_enc;
  15. UA_Boolean sym_dec;
  16. UA_Boolean asym_sign;
  17. UA_Boolean asym_verify;
  18. UA_Boolean sym_sign;
  19. UA_Boolean sym_verify;
  20. UA_Boolean newContext;
  21. UA_Boolean deleteContext;
  22. UA_Boolean makeCertificateThumbprint;
  23. UA_Boolean generateKey;
  24. UA_Boolean generateNonce;
  25. UA_Boolean setLocalSymEncryptingKey;
  26. UA_Boolean setLocalSymSigningKey;
  27. UA_Boolean setLocalSymIv;
  28. UA_Boolean setRemoteSymEncryptingKey;
  29. UA_Boolean setRemoteSymSigningKey;
  30. UA_Boolean setRemoteSymIv;
  31. } funcs_called;
  32. typedef struct key_sizes {
  33. size_t sym_enc_blockSize;
  34. size_t sym_sig_keyLen;
  35. size_t sym_sig_size;
  36. size_t sym_enc_keyLen;
  37. size_t asym_rmt_sig_size;
  38. size_t asym_lcl_sig_size;
  39. size_t asym_rmt_ptext_blocksize;
  40. size_t asym_rmt_blocksize;
  41. size_t asym_rmt_enc_key_size;
  42. size_t asym_lcl_enc_key_size;
  43. } key_sizes;
  44. UA_StatusCode UA_EXPORT
  45. TestingPolicy(UA_SecurityPolicy *policy, UA_ByteString localCertificate,
  46. funcs_called *fCalled, const key_sizes *kSizes);
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif //OPEN62541_TESTING_POLICY_H