Skip to content

OpenSSL platform

«interface»SolidSyslogSecurityPolicyOpenSslHmacSha256PolicyOpenSsl

File SolidSyslogOpenSslHmacSha256Policy.h

FileList > Interface > SolidSyslogOpenSslHmacSha256Policy.h

  • #include "SolidSyslogExternC.h"
  • #include "SolidSyslogKeyFunction.h"

Classes

Type Name
struct SolidSyslogOpenSslHmacSha256PolicyConfig
Supplies the key SolidSyslogOpenSslHmacSha256Policy seals and verifies with.

Detailed Description

A keyed HMAC-SHA256 security policy (OpenSSL reference integration) that authenticates each stored record - tamper-detection for store-and-forward without encryption.

What the policy does through its vtable is the substance:

  • SealRecord computes HMAC-SHA256 over the whole record content (the header/body split matters only to AEAD policies, so it is ignored here) and writes the 32-byte tag into the record trailer. The key is fetched on demand via GetKey and wiped after the computation.
  • OpenRecord recomputes the tag and compares it to the stored trailer in constant time (no early exit, no timing oracle); a mismatch is rejected.
  • If the key is unavailable, shorter than 32 bytes (RFC 2104 / NIST SP 800-107: an HMAC key should be at least the hash output length), or the HMAC computation fails, SealRecord returns false and nothing is sealed, and OpenRecord could not run.

Public Functions Documentation

SolidSyslogOpenSslHmacSha256Policy_Create

Draw a policy from the pool.

struct SolidSyslogSecurityPolicy * SolidSyslogOpenSslHmacSha256Policy_Create (
    const struct SolidSyslogOpenSslHmacSha256PolicyConfig * config
) 

A NULL config or NULL GetKey (bad config), or an exhausted pool, falls back to the shared NullSecurityPolicy.


SolidSyslogOpenSslHmacSha256Policy_Destroy

Release the pool slot.

void SolidSyslogOpenSslHmacSha256Policy_Destroy (
    struct SolidSyslogSecurityPolicy * base
) 

The policy owns no resources - the key is never stored on the instance - so this only frees the slot.



The documentation for this class was generated from the following file Platform/OpenSsl/Interface/SolidSyslogOpenSslHmacSha256Policy.h