Prechádzať zdrojové kódy

make channelcontext pointer non-const

Mark 6 rokov pred
rodič
commit
653b54ea5d

+ 4 - 4
include/ua_plugin_securitypolicy.h

@@ -29,7 +29,7 @@ typedef struct {
      * @param message the message to which the signature is supposed to belong.
      * @param signature the signature of the message, that should be verified. */
     UA_StatusCode (*verify)(const UA_SecurityPolicy *securityPolicy,
-                            const void *channelContext, const UA_ByteString *message,
+                            void *channelContext, const UA_ByteString *message,
                             const UA_ByteString *signature) UA_FUNC_ATTR_WARN_UNUSED_RESULT;
 
     /* Signs the given message using this policys signing algorithm and the
@@ -44,7 +44,7 @@ typedef struct {
      *                  necessary size can be acquired with the signatureSize
      *                  attribute of this module. */
     UA_StatusCode (*sign)(const UA_SecurityPolicy *securityPolicy,
-                          const void *channelContext, const UA_ByteString *message,
+                          void *channelContext, const UA_ByteString *message,
                           UA_ByteString *signature) UA_FUNC_ATTR_WARN_UNUSED_RESULT;
 
     /* Gets the signature size that depends on the local (private) key.
@@ -76,7 +76,7 @@ typedef struct {
      * @param data the data that is encrypted. The encrypted data will overwrite
      *             the data that was supplied. */
     UA_StatusCode(*encrypt)(const UA_SecurityPolicy *securityPolicy,
-                            const void *channelContext,
+                            void *channelContext,
                             UA_ByteString *data) UA_FUNC_ATTR_WARN_UNUSED_RESULT;
 
     /* Decrypts the given ciphertext in place using an asymmetric algorithm and
@@ -87,7 +87,7 @@ typedef struct {
      *                       the keys needed to decrypt the message.
      * @param data the data to decrypt. The decryption is done in place. */
     UA_StatusCode(*decrypt)(const UA_SecurityPolicy *securityPolicy,
-                            const void *channelContext,
+                            void *channelContext,
                             UA_ByteString *data) UA_FUNC_ATTR_WARN_UNUSED_RESULT;
 
     /* Returns the length of the key used locally to encrypt messages in bits

+ 4 - 4
plugins/ua_securitypolicy_none.c

@@ -7,7 +7,7 @@
 
 static UA_StatusCode
 verify_none(const UA_SecurityPolicy *securityPolicy,
-            const void *channelContext,
+            void *channelContext,
             const UA_ByteString *message,
             const UA_ByteString *signature) {
     return UA_STATUSCODE_GOOD;
@@ -15,7 +15,7 @@ verify_none(const UA_SecurityPolicy *securityPolicy,
 
 static UA_StatusCode
 sign_none(const UA_SecurityPolicy *securityPolicy,
-          const void *channelContext,
+          void *channelContext,
           const UA_ByteString *message,
           UA_ByteString *signature) {
     return UA_STATUSCODE_GOOD;
@@ -29,14 +29,14 @@ length_none(const UA_SecurityPolicy *securityPolicy,
 
 static UA_StatusCode
 encrypt_none(const UA_SecurityPolicy *securityPolicy,
-             const void *channelContext,
+             void *channelContext,
              UA_ByteString *data) {
     return UA_STATUSCODE_GOOD;
 }
 
 static UA_StatusCode
 decrypt_none(const UA_SecurityPolicy *securityPolicy,
-             const void *channelContext,
+             void *channelContext,
              UA_ByteString *data) {
     return UA_STATUSCODE_GOOD;
 }

+ 6 - 6
tests/testing-plugins/testing_policy.c

@@ -17,7 +17,7 @@ static const key_sizes *keySizes;
 
 static UA_StatusCode
 verify_testing(const UA_SecurityPolicy *securityPolicy,
-               const void *channelContext,
+               void *channelContext,
                const UA_ByteString *message,
                const UA_ByteString *signature) {
     return UA_STATUSCODE_GOOD;
@@ -25,7 +25,7 @@ verify_testing(const UA_SecurityPolicy *securityPolicy,
 
 static UA_StatusCode
 asym_sign_testing(const UA_SecurityPolicy *securityPolicy,
-                  const void *channelContext,
+                  void *channelContext,
                   const UA_ByteString *message,
                   UA_ByteString *signature) {
     SET_CALLED(asym_sign);
@@ -45,7 +45,7 @@ asym_sign_testing(const UA_SecurityPolicy *securityPolicy,
 
 static UA_StatusCode
 sym_sign_testing(const UA_SecurityPolicy *securityPolicy,
-                 const void *channelContext,
+                 void *channelContext,
                  const UA_ByteString *message,
                  UA_ByteString *signature) {
     SET_CALLED(sym_sign);
@@ -118,7 +118,7 @@ sym_getRemoteEncryptionKeyLength_testing(const UA_SecurityPolicy *securityPolicy
 
 static UA_StatusCode
 sym_encrypt_testing(const UA_SecurityPolicy *securityPolicy,
-                    const void *channelContext,
+                    void *channelContext,
                     UA_ByteString *data) {
     SET_CALLED(sym_enc);
     ck_assert(securityPolicy != NULL);
@@ -129,7 +129,7 @@ sym_encrypt_testing(const UA_SecurityPolicy *securityPolicy,
 
 static UA_StatusCode
 asym_encrypt_testing(const UA_SecurityPolicy *securityPolicy,
-                     const void *channelContext,
+                     void *channelContext,
                      UA_ByteString *data) {
     SET_CALLED(asym_enc);
     ck_assert(securityPolicy != NULL);
@@ -152,7 +152,7 @@ asym_encrypt_testing(const UA_SecurityPolicy *securityPolicy,
 
 static UA_StatusCode
 decrypt_testing(const UA_SecurityPolicy *securityPolicy,
-                const void *channelContext,
+                void *channelContext,
                 UA_ByteString *data) {
     return UA_STATUSCODE_GOOD;
 }