Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't attempt to pack structures with pointers - should fix aarch64 issues #283

Merged
merged 2 commits into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/atcacert/atcacert_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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.
Expand All @@ -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" {
Expand Down
2 changes: 0 additions & 2 deletions python/cryptoauthlib/atcacert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down