Skip to content

Commit 0ce8db0

Browse files
authored
Merge pull request #95 from kstribrnAmzn/fixProvision
Fix certificate generation and provisioning script
2 parents d00576b + f9fb044 commit 0ce8db0

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Common/crypto/PkiObjectPkcs11.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
if( CKR_OK == xResult )
114114
{
115115
/* Add space for DER Header */
116-
*pulPubKeyDerLen = xTemplate.ulValueLen + sizeof( pucEcP256AsnAndOid ) - sizeof( pucUnusedKeyTag ) + 1;
116+
*pulPubKeyDerLen = xTemplate.ulValueLen + sizeof( pucEcP256AsnAndOid ) - sizeof( pucUnusedKeyTag );
117117

118118
/* Allocate a buffer for the DER form of the key */
119119
*ppucPubKeyDer = pvPortMalloc( *pulPubKeyDerLen );

tools/provision.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def __init__(self, args):
337337
# Convert Namespace to dict
338338
args = vars(args)
339339

340-
aws_profile = args.get("aws_profile", "default")
340+
aws_profile = args.get("aws_profile", None)
341341
aws_region_name = args.get("aws_region", None)
342342
aws_access_key_id = args.get("aws_access_key_id", None)
343343
aws_secret_access_key = args.get("aws_secret_access_key", None)
@@ -352,11 +352,10 @@ def __init__(self, args):
352352
)
353353

354354
# If profile is specified, allow boto3 to determine other arguments from ~/.aws/config
355-
elif aws_profile:
355+
elif not aws_profile:
356356
self.session = boto3.session.Session(
357357
profile_name=aws_profile,
358358
)
359-
360359
self.check_credentials()
361360

362361
def check_credentials(self):
@@ -919,7 +918,7 @@ def main():
919918
# Initialize a connection to AWS IoT
920919
aws = AwsHelper(args=args)
921920
if not aws.check_credentials():
922-
print("The provided AWS account credentials are inalid.")
921+
print("The provided AWS account credentials are invalid.")
923922
raise SystemExit
924923

925924
target.conf_set("mqtt_endpoint", aws.get_endpoint())

0 commit comments

Comments
 (0)