Skip to content

Commit

Permalink
Prepare 2.4.1 release (#458)
Browse files Browse the repository at this point in the history
Fix minor bug effecting certain architectures on Linux platforms
  • Loading branch information
aveenismail authored Dec 5, 2023
1 parent ebb7285 commit 1737a94
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ project (yubico-piv-tool)

set (yubico_piv_tool_VERSION_MAJOR 2)
set (yubico_piv_tool_VERSION_MINOR 4)
set (yubico_piv_tool_VERSION_PATCH 0)
set (yubico_piv_tool_VERSION_PATCH 1)
set (VERSION "${yubico_piv_tool_VERSION_MAJOR}.${yubico_piv_tool_VERSION_MINOR}.${yubico_piv_tool_VERSION_PATCH}")
set (SO_VERSION 2)

Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
yubico-piv-tool NEWS -- History of user-visible changes. -*- outline -*-

* Version 2.4.0 (released 2023-12-05)

** ykpiv: ykcs11: Fix minor bug effecting certain architectures on Linux platforms

* Version 2.4.0 (released 2023-11-30)

** ykpiv: cmd: Add support for compressing certificate upon import
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
yubico-piv-tool (2.4.1) stable; urgency=medium

* ykpiv: ykcs11: Fix minor bug effecting certain architectures on Linux platforms

-- Aveen Ismail <[email protected]> Tue, 2 Dec 2023 16:03:59 +0100

yubico-piv-tool (2.4.0) stable; urgency=medium

* ykpiv: cmd: Add support for compressing certificate upon import
Expand Down
4 changes: 2 additions & 2 deletions lib/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ void ykpiv_util_write_certdata(uint8_t *rawdata, size_t rawdata_len, uint8_t com
unsigned long data_len = sizeof (data);

if (YKPIV_OK == (res = _ykpiv_fetch_object(state, object_id, data, &data_len))) {
if ((res = ykpiv_util_get_certdata(data, data_len, buf, buf_len)) != YKPIV_OK) {
if ((res = ykpiv_util_get_certdata(data, data_len, buf, (unsigned long *) buf_len)) != YKPIV_OK) {
DBG("Failed to get certificate data");
return res;
}
Expand Down Expand Up @@ -1554,7 +1554,7 @@ static ykpiv_rc _write_certificate(ykpiv_state *state, uint8_t slot, uint8_t *da
if (req_len < data_len) return YKPIV_SIZE_ERROR; /* detect overflow of unsigned size_t */
if (req_len > _obj_size_max(state)) return YKPIV_SIZE_ERROR; /* obj_size_max includes limits for TLV encoding */

ykpiv_util_write_certdata(data, data_len, certinfo, buf, &offset);
ykpiv_util_write_certdata(data, data_len, certinfo, buf, (unsigned long *) &offset);

// write onto device
return _ykpiv_save_object(state, object_id, buf, offset);
Expand Down
4 changes: 2 additions & 2 deletions ykcs11/token.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ CK_RV token_generate_key(ykpiv_state *state, gen_info_t *gen, CK_BYTE key, CK_BY
if(rv != CKR_OK)
return rv;

ykpiv_util_write_certdata(data, recv_len, YKPIV_CERTINFO_UNCOMPRESSED, certdata, &certdata_len);
ykpiv_util_write_certdata(data, recv_len, YKPIV_CERTINFO_UNCOMPRESSED, certdata, (unsigned long *) &certdata_len);

if(*cert_len < (CK_ULONG)certdata_len) {
DBG("Certificate buffer too small.");
Expand Down Expand Up @@ -497,7 +497,7 @@ CK_RV token_import_cert(ykpiv_state *state, CK_ULONG cert_id, CK_BYTE_PTR in, CK
if (cert_len > YKPIV_OBJ_MAX_SIZE)
return CKR_FUNCTION_FAILED;

ykpiv_util_write_certdata(in, cert_len, YKPIV_CERTINFO_UNCOMPRESSED, certdata, &certdata_len);
ykpiv_util_write_certdata(in, cert_len, YKPIV_CERTINFO_UNCOMPRESSED, certdata, (unsigned long *) &certdata_len);

// Store the certificate into the token
if ((res = ykpiv_save_object(state, cert_id, certdata, certdata_len)) != YKPIV_OK)
Expand Down

0 comments on commit 1737a94

Please sign in to comment.