Skip to content

Commit 84cd6d5

Browse files
committed
20210511
1 parent ff22b80 commit 84cd6d5

3 files changed

Lines changed: 26 additions & 24 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,19 @@ jobs:
1919
- uses: actions/setup-python@v2
2020
name: Install Python
2121
with:
22-
python-version: '3.7'
22+
python-version: '3.8'
2323

2424
- name: Describe Tag & Branch Name
2525
id: build_names
2626
shell: bash
2727
run: |
2828
echo ::set-output name=TAG_NAME::${GITHUB_REF#refs/tags/}
2929
30-
- name: Install cibuildwheel
31-
run: |
32-
python -m pip install cibuildwheel
33-
34-
- name: Install Visual C++ for Python 2.7
35-
if: runner.os == 'Windows'
36-
run: |
37-
choco install vcpython27 -f -y
30+
# Configure compilers for Windows. Does nothing on Linux/Mac.
31+
- name: Enable Developer Command Prompt
32+
uses: ilammy/msvc-dev-cmd@v1
3833

39-
- name: Build wheels
34+
- name: Configure Environment
4035
shell: bash
4136
run: |
4237
echo $TAG_NAME
@@ -46,11 +41,16 @@ jobs:
4641
cp -r ../third_party .
4742
mkdir app
4843
cp -r ../app/tng app
49-
python -m cibuildwheel --output-dir wheelhouse
5044
env:
51-
CIBW_BUILD_VERBOSITY: 3
5245
TAG_NAME: ${{ steps.build_names.outputs.TAG_NAME }}
5346

47+
- name: Build wheels
48+
uses: joerick/cibuildwheel@v1.11.0
49+
with:
50+
package-dir: python
51+
env:
52+
CIBW_BUILD_VERBOSITY: 3
53+
5454
- uses: actions/upload-artifact@v2
5555
with:
5656
path: python/wheelhouse/*.whl

lib/pkcs11/pkcs11_key.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,16 @@ static CK_RV pkcs11_key_get_ec_point(CK_VOID_PTR pObject, CK_ATTRIBUTE_PTR pAttr
244244

245245
if (obj_ptr)
246246
{
247+
ATCA_STATUS status = ATCA_SUCCESS;
248+
CK_UTF8CHAR ec_asn1_key[3 + ATCA_ECCP256_PUBKEY_SIZE] = { 0x04, 0x41, 0x04 };
249+
247250
if (pAttribute->pValue)
248251
{
249252
CK_BBOOL is_private;
250253

251254
if (CKR_OK == (rv = pkcs11_object_is_private(obj_ptr, &is_private)))
252255
{
253-
CK_UTF8CHAR ec_asn1_key[3 + ATCA_ECCP256_PUBKEY_SIZE] = { 0x04, 0x41, 0x04 };
254-
ATCA_STATUS status;
256+
255257

256258
if (is_private)
257259
{
@@ -263,17 +265,17 @@ static CK_RV pkcs11_key_get_ec_point(CK_VOID_PTR pObject, CK_ATTRIBUTE_PTR pAttr
263265
status = atcab_read_pubkey(obj_ptr->slot, &ec_asn1_key[3]);
264266
PKCS11_DEBUG("atcab_read_pubkey: %x\r\n", status);
265267
}
266-
267-
if (ATCA_SUCCESS == status)
268-
{
269-
rv = pkcs11_attrib_fill(pAttribute, ec_asn1_key, sizeof(ec_asn1_key));
270-
}
271-
else
272-
{
273-
rv = CKR_FUNCTION_FAILED;
274-
}
275268
}
276269
}
270+
271+
if (ATCA_SUCCESS == status)
272+
{
273+
rv = pkcs11_attrib_fill(pAttribute, ec_asn1_key, sizeof(ec_asn1_key));
274+
}
275+
else
276+
{
277+
rv = CKR_FUNCTION_FAILED;
278+
}
277279
}
278280

279281
return rv;

python/cryptoauthlib/atcab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR
2222
# THIS SOFTWARE.
2323

24-
from ctypes import c_uint8, c_uint32, byref, create_string_buffer, Structure, c_char, c_uint16, c_bool
24+
from ctypes import c_uint8, c_uint32, byref, create_string_buffer, Structure, c_char, c_uint16, c_bool, c_void_p
2525
from .status import Status
2626
from .library import get_cryptoauthlib, AtcaReference
2727

0 commit comments

Comments
 (0)