testing_policy.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. #include <open62541/plugin/log.h>
  7. #include <open62541/plugin/securitypolicy.h>
  8. _UA_BEGIN_DECLS
  9. typedef struct funcs_called {
  10. UA_Boolean asym_enc;
  11. UA_Boolean asym_dec;
  12. UA_Boolean sym_enc;
  13. UA_Boolean sym_dec;
  14. UA_Boolean asym_sign;
  15. UA_Boolean asym_verify;
  16. UA_Boolean sym_sign;
  17. UA_Boolean sym_verify;
  18. UA_Boolean newContext;
  19. UA_Boolean deleteContext;
  20. UA_Boolean makeCertificateThumbprint;
  21. UA_Boolean generateKey;
  22. UA_Boolean generateNonce;
  23. UA_Boolean setLocalSymEncryptingKey;
  24. UA_Boolean setLocalSymSigningKey;
  25. UA_Boolean setLocalSymIv;
  26. UA_Boolean setRemoteSymEncryptingKey;
  27. UA_Boolean setRemoteSymSigningKey;
  28. UA_Boolean setRemoteSymIv;
  29. } funcs_called;
  30. typedef struct key_sizes {
  31. size_t sym_enc_blockSize;
  32. size_t sym_sig_keyLen;
  33. size_t sym_sig_size;
  34. size_t sym_enc_keyLen;
  35. size_t asym_rmt_sig_size;
  36. size_t asym_lcl_sig_size;
  37. size_t asym_rmt_ptext_blocksize;
  38. size_t asym_rmt_blocksize;
  39. size_t asym_rmt_enc_key_size;
  40. size_t asym_lcl_enc_key_size;
  41. } key_sizes;
  42. UA_StatusCode UA_EXPORT
  43. TestingPolicy(UA_SecurityPolicy *policy, UA_ByteString localCertificate,
  44. funcs_called *fCalled, const key_sizes *kSizes);
  45. _UA_END_DECLS
  46. #endif //OPEN62541_TESTING_POLICY_H