|
@@ -29,9 +29,8 @@ typedef struct {
|
|
* @param message the message to which the signature is supposed to belong.
|
|
* @param message the message to which the signature is supposed to belong.
|
|
* @param signature the signature of the message, that should be verified. */
|
|
* @param signature the signature of the message, that should be verified. */
|
|
UA_StatusCode (*verify)(const UA_SecurityPolicy *securityPolicy,
|
|
UA_StatusCode (*verify)(const UA_SecurityPolicy *securityPolicy,
|
|
- const void *channelContext,
|
|
|
|
- const UA_ByteString *message,
|
|
|
|
- const UA_ByteString *signature);
|
|
|
|
|
|
+ const 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
|
|
/* Signs the given message using this policys signing algorithm and the
|
|
* provided keys in the context.
|
|
* provided keys in the context.
|
|
@@ -45,9 +44,8 @@ typedef struct {
|
|
* necessary size can be acquired with the signatureSize
|
|
* necessary size can be acquired with the signatureSize
|
|
* attribute of this module. */
|
|
* attribute of this module. */
|
|
UA_StatusCode (*sign)(const UA_SecurityPolicy *securityPolicy,
|
|
UA_StatusCode (*sign)(const UA_SecurityPolicy *securityPolicy,
|
|
- const void *channelContext,
|
|
|
|
- const UA_ByteString *message,
|
|
|
|
- UA_ByteString *signature);
|
|
|
|
|
|
+ const 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.
|
|
/* Gets the signature size that depends on the local (private) key.
|
|
*
|
|
*
|
|
@@ -79,7 +77,8 @@ typedef struct {
|
|
* the data that was supplied. */
|
|
* the data that was supplied. */
|
|
UA_StatusCode(*encrypt)(const UA_SecurityPolicy *securityPolicy,
|
|
UA_StatusCode(*encrypt)(const UA_SecurityPolicy *securityPolicy,
|
|
const void *channelContext,
|
|
const void *channelContext,
|
|
- UA_ByteString *data);
|
|
|
|
|
|
+ UA_ByteString *data) UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
+
|
|
/* Decrypts the given ciphertext in place using an asymmetric algorithm and
|
|
/* Decrypts the given ciphertext in place using an asymmetric algorithm and
|
|
* key.
|
|
* key.
|
|
*
|
|
*
|
|
@@ -89,7 +88,7 @@ typedef struct {
|
|
* @param data the data to decrypt. The decryption is done in place. */
|
|
* @param data the data to decrypt. The decryption is done in place. */
|
|
UA_StatusCode(*decrypt)(const UA_SecurityPolicy *securityPolicy,
|
|
UA_StatusCode(*decrypt)(const UA_SecurityPolicy *securityPolicy,
|
|
const void *channelContext,
|
|
const void *channelContext,
|
|
- UA_ByteString *data);
|
|
|
|
|
|
+ UA_ByteString *data) UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
|
|
/* Returns the length of the key used locally to encrypt messages in bits
|
|
/* Returns the length of the key used locally to encrypt messages in bits
|
|
*
|
|
*
|
|
@@ -120,7 +119,8 @@ typedef struct {
|
|
* asymmetricModule. */
|
|
* asymmetricModule. */
|
|
UA_StatusCode (*makeCertificateThumbprint)(const UA_SecurityPolicy *securityPolicy,
|
|
UA_StatusCode (*makeCertificateThumbprint)(const UA_SecurityPolicy *securityPolicy,
|
|
const UA_ByteString *certificate,
|
|
const UA_ByteString *certificate,
|
|
- UA_ByteString *thumbprint);
|
|
|
|
|
|
+ UA_ByteString *thumbprint)
|
|
|
|
+ UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
|
|
/* Compares the supplied certificate with the certificate in the endpoit context.
|
|
/* Compares the supplied certificate with the certificate in the endpoit context.
|
|
*
|
|
*
|
|
@@ -131,7 +131,8 @@ typedef struct {
|
|
* @return if the thumbprints match UA_STATUSCODE_GOOD is returned. If they
|
|
* @return if the thumbprints match UA_STATUSCODE_GOOD is returned. If they
|
|
* don't match or an error occured an error code is returned. */
|
|
* don't match or an error occured an error code is returned. */
|
|
UA_StatusCode (*compareCertificateThumbprint)(const UA_SecurityPolicy *securityPolicy,
|
|
UA_StatusCode (*compareCertificateThumbprint)(const UA_SecurityPolicy *securityPolicy,
|
|
- const UA_ByteString *certificateThumbprint);
|
|
|
|
|
|
+ const UA_ByteString *certificateThumbprint)
|
|
|
|
+ UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
|
|
UA_SecurityPolicyCryptoModule cryptoModule;
|
|
UA_SecurityPolicyCryptoModule cryptoModule;
|
|
} UA_SecurityPolicyAsymmetricModule;
|
|
} UA_SecurityPolicyAsymmetricModule;
|
|
@@ -149,8 +150,8 @@ typedef struct {
|
|
* number of output bytes that are produced. */
|
|
* number of output bytes that are produced. */
|
|
UA_StatusCode (*generateKey)(const UA_SecurityPolicy *securityPolicy,
|
|
UA_StatusCode (*generateKey)(const UA_SecurityPolicy *securityPolicy,
|
|
const UA_ByteString *secret,
|
|
const UA_ByteString *secret,
|
|
- const UA_ByteString *seed,
|
|
|
|
- UA_ByteString *out);
|
|
|
|
|
|
+ const UA_ByteString *seed, UA_ByteString *out)
|
|
|
|
+ UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
/* Random generator for generating nonces.
|
|
/* Random generator for generating nonces.
|
|
*
|
|
*
|
|
* @param securityPolicy the securityPolicy this function is invoked on.
|
|
* @param securityPolicy the securityPolicy this function is invoked on.
|
|
@@ -160,7 +161,8 @@ typedef struct {
|
|
* allocated by the caller. The buffer is filled with random
|
|
* allocated by the caller. The buffer is filled with random
|
|
* data. */
|
|
* data. */
|
|
UA_StatusCode (*generateNonce)(const UA_SecurityPolicy *securityPolicy,
|
|
UA_StatusCode (*generateNonce)(const UA_SecurityPolicy *securityPolicy,
|
|
- UA_ByteString *out);
|
|
|
|
|
|
+ UA_ByteString *out)
|
|
|
|
+ UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
|
|
UA_SecurityPolicyCryptoModule cryptoModule;
|
|
UA_SecurityPolicyCryptoModule cryptoModule;
|
|
size_t encryptionBlockSize;
|
|
size_t encryptionBlockSize;
|
|
@@ -186,7 +188,8 @@ typedef struct {
|
|
* functions that work on a context. */
|
|
* functions that work on a context. */
|
|
UA_StatusCode (*newContext)(const UA_SecurityPolicy *securityPolicy,
|
|
UA_StatusCode (*newContext)(const UA_SecurityPolicy *securityPolicy,
|
|
const UA_ByteString *remoteCertificate,
|
|
const UA_ByteString *remoteCertificate,
|
|
- void **channelContext);
|
|
|
|
|
|
+ void **channelContext)
|
|
|
|
+ UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
|
|
/* Deletes the the security context. */
|
|
/* Deletes the the security context. */
|
|
void (*deleteContext)(void *channelContext);
|
|
void (*deleteContext)(void *channelContext);
|
|
@@ -196,41 +199,48 @@ typedef struct {
|
|
* @param channelContext the context to work on.
|
|
* @param channelContext the context to work on.
|
|
* @param key the local encrypting key to store in the context. */
|
|
* @param key the local encrypting key to store in the context. */
|
|
UA_StatusCode (*setLocalSymEncryptingKey)(void *channelContext,
|
|
UA_StatusCode (*setLocalSymEncryptingKey)(void *channelContext,
|
|
- const UA_ByteString *key);
|
|
|
|
|
|
+ const UA_ByteString *key)
|
|
|
|
+ UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
|
|
/* Sets the local signing key in the supplied context.
|
|
/* Sets the local signing key in the supplied context.
|
|
*
|
|
*
|
|
* @param channelContext the context to work on.
|
|
* @param channelContext the context to work on.
|
|
* @param key the local signing key to store in the context. */
|
|
* @param key the local signing key to store in the context. */
|
|
UA_StatusCode (*setLocalSymSigningKey)(void *channelContext,
|
|
UA_StatusCode (*setLocalSymSigningKey)(void *channelContext,
|
|
- const UA_ByteString *key);
|
|
|
|
|
|
+ const UA_ByteString *key)
|
|
|
|
+ UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
|
|
/* Sets the local initialization vector in the supplied context.
|
|
/* Sets the local initialization vector in the supplied context.
|
|
*
|
|
*
|
|
* @param channelContext the context to work on.
|
|
* @param channelContext the context to work on.
|
|
* @param iv the local initialization vector to store in the context. */
|
|
* @param iv the local initialization vector to store in the context. */
|
|
UA_StatusCode (*setLocalSymIv)(void *channelContext,
|
|
UA_StatusCode (*setLocalSymIv)(void *channelContext,
|
|
- const UA_ByteString *iv);
|
|
|
|
|
|
+ const UA_ByteString *iv)
|
|
|
|
+ UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
+
|
|
/* Sets the remote encrypting key in the supplied context.
|
|
/* Sets the remote encrypting key in the supplied context.
|
|
*
|
|
*
|
|
* @param channelContext the context to work on.
|
|
* @param channelContext the context to work on.
|
|
* @param key the remote encrypting key to store in the context. */
|
|
* @param key the remote encrypting key to store in the context. */
|
|
UA_StatusCode (*setRemoteSymEncryptingKey)(void *channelContext,
|
|
UA_StatusCode (*setRemoteSymEncryptingKey)(void *channelContext,
|
|
- const UA_ByteString *key);
|
|
|
|
|
|
+ const UA_ByteString *key)
|
|
|
|
+ UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
|
|
/* Sets the remote signing key in the supplied context.
|
|
/* Sets the remote signing key in the supplied context.
|
|
*
|
|
*
|
|
* @param channelContext the context to work on.
|
|
* @param channelContext the context to work on.
|
|
* @param key the remote signing key to store in the context. */
|
|
* @param key the remote signing key to store in the context. */
|
|
UA_StatusCode (*setRemoteSymSigningKey)(void *channelContext,
|
|
UA_StatusCode (*setRemoteSymSigningKey)(void *channelContext,
|
|
- const UA_ByteString *key);
|
|
|
|
|
|
+ const UA_ByteString *key)
|
|
|
|
+ UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
|
|
/* Sets the remote initialization vector in the supplied context.
|
|
/* Sets the remote initialization vector in the supplied context.
|
|
*
|
|
*
|
|
* @param channelContext the context to work on.
|
|
* @param channelContext the context to work on.
|
|
* @param iv the remote initialization vector to store in the context. */
|
|
* @param iv the remote initialization vector to store in the context. */
|
|
UA_StatusCode (*setRemoteSymIv)(void *channelContext,
|
|
UA_StatusCode (*setRemoteSymIv)(void *channelContext,
|
|
- const UA_ByteString *iv);
|
|
|
|
|
|
+ const UA_ByteString *iv)
|
|
|
|
+ UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
|
|
/* Compares the supplied certificate with the certificate in the channel
|
|
/* Compares the supplied certificate with the certificate in the channel
|
|
* context.
|
|
* context.
|
|
@@ -241,7 +251,8 @@ typedef struct {
|
|
* @return if the certificates match UA_STATUSCODE_GOOD is returned. If they
|
|
* @return if the certificates match UA_STATUSCODE_GOOD is returned. If they
|
|
* don't match or an errror occured an error code is returned. */
|
|
* don't match or an errror occured an error code is returned. */
|
|
UA_StatusCode (*compareCertificate)(const void *channelContext,
|
|
UA_StatusCode (*compareCertificate)(const void *channelContext,
|
|
- const UA_ByteString *certificate);
|
|
|
|
|
|
+ const UA_ByteString *certificate)
|
|
|
|
+ UA_FUNC_ATTR_WARN_UNUSED_RESULT;
|
|
|
|
|
|
/* Gets the plaintext block size that depends on the remote public key.
|
|
/* Gets the plaintext block size that depends on the remote public key.
|
|
*
|
|
*
|