Files
torstenandCopilot 342ffd3e5c Update submodule to latest BUILD_RTI fixes
- HandlerMinelayerData: BUILD_RTI Guards für RTI-Abhängigkeiten
- svcTabCommon: Export-Header-Fix via Fallback-Target
- TrainingAreaBase: Stub-Header für BUILD_RTI=OFF
- ddsfts: Include-Pfad und Dependency-Fixes
- BUILD_RTI=OFF Compilation vollständig unterstützt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Entire-Checkpoint: 01M0JNZA586SACX1PRZ2DJAE5S
2026-08-21 19:30:20 +02:00

97 lines
3.9 KiB
C

/**
* (c) Copyright, Real-Time Innovations, 2014-2016.
* All rights reserved.
* No duplications, whole or partial, manual or electronic, may be made
* without express written permission. Any such copies, or
* revisions thereof, must display this notice unaltered.
* This code contains trade secrets of Real-Time Innovations, Inc.
*
* Description
* -----------
* Default create functions for security plugins
* =====================================================================
*/
#ifndef security_cryptography_h
#define security_cryptography_h
#ifndef security_infrastructure_h
#include "security/security_infrastructure.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define DDS_SecureSubmessage_INVALID \
DDS_TrustedSubmessage_INVALID
#define DDS_SecureSubmessage_INFO_SUBMESSAGE \
DDS_TrustedSubmessage_INFO_SUBMESSAGE
#define DDS_SecureSubmessage_DATAWRITER_SUBMESSAGE \
DDS_TrustedSubmessage_DATAWRITER_SUBMESSAGE
#define DDS_SecureSubmessage_DATAREADER_SUBMESSAGE \
DDS_TrustedSubmessage_DATAREADER_SUBMESSAGE
typedef DDS_TrustedSubmessageCategory_t DDS_SecureSubmessageCategory_t;
/*
* According to
* https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf ,
* 8.3 Constraints on the Number of Invocations, there's a 2^32 limit for max
* invocations per key *unless* we use 96-bit IVs that are deterministically
* constructed. Our IVs do fit that description. According to the DDS Security
* specification, "Computation of ciphertext from plaintext", the encryption
* operation uses a 96-bit initialization vector constructed as:
*
* InitializationVector = SessionId | InitializationVectorSuffix
*
* According to the DDS Security specification, the SessionId is 4 bytes and
* the InitializationVectorSuffix is 8 bytes. The SessionId stays the same
* throughout the session. The InitializationVectorSuffix is initially random,
* but since the InitializationVector is "incremented each time any of those
* keys are used", InitializationVectorSuffix must be incremented with each
* invocation. So the IV is deterministically constructed. We construct it that
* way in our implementation. So this 2^32 limit doesn't apply to us. Our
* default limit is 2^64 - 1. So after 2^64 - 1 invocations of the same
* "session" key material, which is derived from the "master" key material and
* the SessionId, we will increment the SessionId and derive new "session" key
* material from the same "master" key material. The "master" key material is
* randomly generated for each DDS entity at the time you create the entity.
*/
#define RTI_SECURITY_MAX_BLOCKS_PER_SESSION_PROPERTY_DEFAULT 0xffffffffffffffffULL
#define RTI_SECURITY_CRYPTOGRAPHY_CIPHER_ALGO_AUTO "AUTO"
#define RTI_SECURITY_CRYPTOGRAPHY_CIPHER_ALGO_AES_128 "AES128+GCM"
#define RTI_SECURITY_CRYPTOGRAPHY_CIPHER_ALGO_AES_256 "AES256+GCM"
#define RTI_SECURITY_CRYPTOGRAPHY_CIPHER_ALGO_SM4 "SM4+GCM"
/* key 16 bytes, IV 12 bytes */
#define RTI_SECURITY_CRYPTOGRAPHY_CIPHER_ALGO_AES_128_LEGACY "aes-128-gcm"
/* key 32 bytes, IV 12 bytes */
#define RTI_SECURITY_CRYPTOGRAPHY_CIPHER_ALGO_AES_256_LEGACY "aes-256-gcm"
#define RTI_SECURITY_MAX_RECEIVER_SPECIFIC_MACS_PROPERTY_AUTO -1
#define RTI_SECURITY_MAX_RECEIVER_SPECIFIC_MACS_PROPERTY_MIN \
RTI_SECURITY_MAX_RECEIVER_SPECIFIC_MACS_PROPERTY_AUTO
#define RTI_SECURITY_MAX_RECEIVER_SPECIFIC_MACS_PROPERTY_DEFAULT \
RTI_SECURITY_MAX_RECEIVER_SPECIFIC_MACS_PROPERTY_AUTO
/* 3275 = 65507 (UDPv4 message_size_max) / 20 (sizeof(ReceiverSpecificMAC)). */
#define RTI_SECURITY_MAX_RECEIVER_SPECIFIC_MACS_PROPERTY_MAX 3275
#define RTI_SECURITY_KEY_REVISION_MAX_HISTORY_DEPTH_PROPERTY_MAX 1000000
#define RTI_SECURITY_SHARE_KEY_FOR_METADATA_AND_DATA_PROTECTION_PROPERTY_DEFAULT \
RTI_TRUE
/*
* according to https://wiki.openssl.org/index.php/EVP_Authenticated_
* Encryption_and_Decryption
*/
#define RTI_SECURITY_AES_GCM_TAG_LENGTH 16
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* security_cryptography_h */