diff --git a/lib/atcacert/atcacert_def.h b/lib/atcacert/atcacert_def.h index 1a48557ef..ec6d85a8b 100644 --- a/lib/atcacert/atcacert_def.h +++ b/lib/atcacert/atcacert_def.h @@ -166,13 +166,17 @@ typedef struct ATCA_PACKED atcacert_cert_element_s atcacert_transform_t transforms[ATCA_MAX_TRANSFORMS]; //!< List of transforms from device to cert for this element. } atcacert_cert_element_t; +#ifndef ATCA_NO_PRAGMA_PACK +#pragma pack(pop) +#endif + /** * Defines a certificate and all the pieces to work with it. * * If any of the standard certificate elements (std_cert_elements) are not a part of the certificate * definition, set their count to 0 to indicate their absence. */ -typedef struct ATCA_PACKED atcacert_def_s +typedef struct atcacert_def_s { atcacert_cert_type_t type; //!< Certificate type. uint8_t template_id; //!< ID for the this certificate definition (4-bit value). @@ -198,7 +202,7 @@ typedef struct ATCA_PACKED atcacert_def_s * Tracks the state of a certificate as it's being rebuilt from device information. */ -typedef struct ATCA_PACKED atcacert_build_state_s +typedef struct atcacert_build_state_s { const atcacert_def_t* cert_def; //!< Certificate definition for the certificate being rebuilt. uint8_t* cert; //!< Buffer to contain the rebuilt certificate. @@ -208,10 +212,6 @@ typedef struct ATCA_PACKED atcacert_build_state_s uint8_t device_sn[9]; //!< Storage for the device SN, when it's found. } atcacert_build_state_t; -#ifndef ATCA_NO_PRAGMA_PACK -#pragma pack(pop) -#endif - // Inform function naming when compiling in C++ #ifdef __cplusplus extern "C" { diff --git a/python/cryptoauthlib/atcacert.py b/python/cryptoauthlib/atcacert.py index 56156d6ba..c2a10e519 100644 --- a/python/cryptoauthlib/atcacert.py +++ b/python/cryptoauthlib/atcacert.py @@ -221,8 +221,6 @@ class atcacert_def_t(AtcaStructure): """ CTypes mirror of atcacert_def_t from atcacert_def.h """ - _pack_ = 1 - def __init__(self, *args, **kwargs): if kwargs is not None: _atcacert_convert_enum(kwargs, 'type', atcacert_cert_type_t)