aboutsummaryrefslogtreecommitdiffstats
path: root/lib/includes/hicn/protocol/ah.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/includes/hicn/protocol/ah.h')
-rw-r--r--lib/includes/hicn/protocol/ah.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/includes/hicn/protocol/ah.h b/lib/includes/hicn/protocol/ah.h
index a59a5051a..36fd7d509 100644
--- a/lib/includes/hicn/protocol/ah.h
+++ b/lib/includes/hicn/protocol/ah.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 Cisco and/or its affiliates.
+ * Copyright (c) 2021 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -35,16 +35,19 @@
typedef struct
{
- u8 nh; // (to match with reserved in IPSEC AH)
- u8 payloadlen; // Len of signature/HMAC in 4-bytes words
+ u8 nh; // To match with reserved in IPSEC AH
+ // Length of the signature field. Note that the signature might be smaller
+ // than the field: the actual size is computed from the field size and
+ // signaturePadding.
+ u8 payloadlen;
union
{
u16 reserved;
struct
{
- u8 validationAlgorithm; // As defined in parc_SignerAlgorithm.h
- u8 unused; // Unused (to match with reserved in IPSEC AH)
+ u8 validationAlgorithm;
+ u8 signaturePadding;
};
};
union
@@ -60,12 +63,12 @@ typedef struct
u32 timestamp_as_u32[2];
};
// ICV would follow
- u8 keyId[32]; // Hash of the pub key
+ u8 keyId[32]; // Hash of pub key
/* 44 B + validationPayload */
- u8 validationPayload[0]; // Holds the signature
+ u8 validationPayload[0]; // Holds the signature
} _ah_header_t;
-#define AH_HDRLEN sizeof(_ah_header_t)
+#define AH_HDRLEN sizeof (_ah_header_t)
static_assert (EXPECTED_AH_HDRLEN == AH_HDRLEN,
"Size of AH Struct does not match its expected size.");