From 66c5a947fd74203c26fd5464ac03c103ffeaba75 Mon Sep 17 00:00:00 2001 From: Stanislav Klima Date: Wed, 20 Jul 2022 08:56:59 +0200 Subject: [PATCH] XSTRNCPY, fixed typos --- tests/api.c | 17 ++++++++--------- wolfcrypt/src/asn.c | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/api.c b/tests/api.c index 6dbc055ce..38daa8123 100644 --- a/tests/api.c +++ b/tests/api.c @@ -47073,8 +47073,7 @@ static void test_wc_ParseCert(void) static void test_MakeCertWithPathLen(void) { -#if defined(WOLFSSL_CERT_REQ) && defined(WOLFSSL_CERT_GEN) && \ - defined(WOLFSSL_KEY_GEN) && defined(HAVE_ECC) +#if defined(WOLFSSL_CERT_REQ) && defined(WOLFSSL_CERT_GEN) && defined(HAVE_ECC) const byte expectedPathLen = 7; Cert cert; DecodedCert decodedCert; @@ -47090,13 +47089,13 @@ static void test_MakeCertWithPathLen(void) AssertIntEQ(wc_ecc_make_key(&rng, 32, &key), 0); AssertIntEQ(wc_InitCert(&cert), 0); - (void)strncpy(cert.subject.country, "US", CTC_NAME_SIZE); - (void)strncpy(cert.subject.state, "state", CTC_NAME_SIZE); - (void)strncpy(cert.subject.locality, "Bozeman", CTC_NAME_SIZE); - (void)strncpy(cert.subject.org, "yourOrgNameHere", CTC_NAME_SIZE); - (void)strncpy(cert.subject.unit, "yourUnitNameHere", CTC_NAME_SIZE); - (void)strncpy(cert.subject.commonName, "www.yourDomain.com", CTC_NAME_SIZE); - (void)strncpy(cert.subject.email, "yourEmail@yourDomain.com", CTC_NAME_SIZE); + (void)XSTRNCPY(cert.subject.country, "US", CTC_NAME_SIZE); + (void)XSTRNCPY(cert.subject.state, "state", CTC_NAME_SIZE); + (void)XSTRNCPY(cert.subject.locality, "Bozeman", CTC_NAME_SIZE); + (void)XSTRNCPY(cert.subject.org, "yourOrgNameHere", CTC_NAME_SIZE); + (void)XSTRNCPY(cert.subject.unit, "yourUnitNameHere", CTC_NAME_SIZE); + (void)XSTRNCPY(cert.subject.commonName, "www.yourDomain.com", CTC_NAME_SIZE); + (void)XSTRNCPY(cert.subject.email, "yourEmail@yourDomain.com", CTC_NAME_SIZE); cert.selfSigned = 1; cert.isCA = 1; diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index d16df3f12..53807c70b 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -24946,7 +24946,7 @@ static int EncodeCert(Cert* cert, DerCert* der, RsaKey* rsaKey, ecc_key* eccKey, der->extensionsSz = 0; /* RFC 5280 : 4.2.1.9. Basic Constraints - * The pathLenConstraint field is meaningful only if the cA boolean is + * The pathLenConstraint field is meaningful only if the CA boolean is * asserted and the key usage extension, if present, asserts the * keyCertSign bit */ /* Set CA and path length */ @@ -26133,7 +26133,7 @@ static int EncodeCertReq(Cert* cert, DerCert* der, RsaKey* rsaKey, der->extensionsSz = 0; /* RFC 5280 : 4.2.1.9. Basic Constraints - * The pathLenConstraint field is meaningful only if the cA boolean is + * The pathLenConstraint field is meaningful only if the CA boolean is * asserted and the key usage extension, if present, asserts the * keyCertSign bit */ /* Set CA and path length */