Browse Source

Spelling and whitespace cleanups.

David Garske 1 year ago
parent
commit
606f58a851
5 changed files with 22 additions and 22 deletions
  1. 2 2
      IDE/Android/user_settings.h
  2. 4 4
      src/x509.c
  3. 8 8
      wolfcrypt/src/asn.c
  4. 6 6
      wolfcrypt/src/evp.c
  5. 2 2
      wolfcrypt/src/tfm.c

+ 2 - 2
IDE/Android/user_settings.h

@@ -11,7 +11,7 @@
 #ifdef __aarch64__
     #if !defined(__clang__) || \
         (defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 5)
-        /* older clang v4 has issue with inline assembly contraints */
+        /* older clang v4 has issue with inline assembly constraints */
         #define WOLFSSL_ARMASM
     #endif
 #endif
@@ -58,7 +58,7 @@
 #define HAVE_PK_CALLBACKS
 /* crypto callback support is not in FIPS 3389 */
 #ifndef HAVE_FIPS
-    #define WOLF_CRYPTO_CB 
+    #define WOLF_CRYPTO_CB
 #endif
 
 #define KEEP_OUR_CERT

+ 4 - 4
src/x509.c

@@ -6013,7 +6013,7 @@ static int X509PrintPubKey(WOLFSSL_BIO* bio, WOLFSSL_X509* x509, int indent)
     switch (x509->pubKeyOID) {
     #ifndef NO_RSA
         case RSAk:
-            len = XSNPRINTF(scratch, MAX_WIDTH, 
+            len = XSNPRINTF(scratch, MAX_WIDTH,
                     "%*sPublic Key Algorithm: rsaEncryption\n", indent + 4, "");
             if (len >= MAX_WIDTH)
                 return WOLFSSL_FAILURE;
@@ -6023,7 +6023,7 @@ static int X509PrintPubKey(WOLFSSL_BIO* bio, WOLFSSL_X509* x509, int indent)
     #endif
     #ifdef HAVE_ECC
         case ECDSAk:
-            len = XSNPRINTF(scratch, MAX_WIDTH, 
+            len = XSNPRINTF(scratch, MAX_WIDTH,
                     "%*sPublic Key Algorithm: EC\n", indent + 4, "");
             if (len >= MAX_WIDTH)
                 return WOLFSSL_FAILURE;
@@ -6031,11 +6031,11 @@ static int X509PrintPubKey(WOLFSSL_BIO* bio, WOLFSSL_X509* x509, int indent)
                 return WOLFSSL_FAILURE;
             break;
     #endif
-    	default:
+        default:
                 WOLFSSL_MSG("Unknown key type");
                 return WOLFSSL_FAILURE;
     }
-    
+
     pubKey = wolfSSL_X509_get_pubkey(x509);
     if (pubKey == NULL)
         return WOLFSSL_FAILURE;

+ 8 - 8
wolfcrypt/src/asn.c

@@ -401,7 +401,7 @@ static word32 SizeASNLength(word32 length)
     #define DECL_ASNGETDATA(name, cnt)                  \
         ASNGetData name[cnt]
 
-    /* No implementation as declartion is static.
+    /* No implementation as declaration is static.
      *
      * @param [in]      name  Variable name to declare.
      * @param [in]      cnt   Number of elements required.
@@ -420,7 +420,7 @@ static word32 SizeASNLength(word32 length)
     #define CALLOC_ASNGETDATA(name, cnt, err, heap)     \
         XMEMSET(name, 0, sizeof(name))
 
-    /* No implementation as declartion is static.
+    /* No implementation as declaration is static.
      *
      * @param [in]      name  Variable name to declare.
      * @param [in]      heap  Dynamic memory allocation hint.
@@ -435,7 +435,7 @@ static word32 SizeASNLength(word32 length)
     #define DECL_ASNSETDATA(name, cnt)                  \
         ASNSetData name[cnt]
 
-    /* No implementation as declartion is static.
+    /* No implementation as declaration is static.
      *
      * @param [in]      name  Variable name to declare.
      * @param [in]      cnt   Number of elements required.
@@ -454,7 +454,7 @@ static word32 SizeASNLength(word32 length)
     #define CALLOC_ASNSETDATA(name, cnt, err, heap)     \
         XMEMSET(name, 0, sizeof(name))
 
-    /* No implementation as declartion is static.
+    /* No implementation as declaration is static.
      *
      * @param [in]      name  Variable name to declare.
      * @param [in]      heap  Dynamic memory allocation hint.
@@ -2107,7 +2107,7 @@ int GetLength_ex(const byte* input, word32* inOutIdx, int* len, word32 maxIdx,
     /* Check if the first byte indicates the count of bytes. */
     if (b >= ASN_LONG_LENGTH) {
         /* Bottom 7 bits are the number of bytes to calculate length with.
-         * Note: 0 indicates indefinte length encoding *not* 0 bytes of length.
+         * Note: 0 indicates indefinite length encoding *not* 0 bytes of length.
          */
         word32 bytes = b & 0x7F;
         int minLen;
@@ -3680,7 +3680,7 @@ int wc_BerToDer(const byte* ber, word32 berSz, byte* der, word32* derSz)
 
                 /* Set the header length to include the length field */
                 IndefItems_UpdateHeaderLen(indefItems);
-                /* Go to indefinte parent item */
+                /* Go to indefinite parent item */
                 IndefItems_Up(indefItems);
             }
         }
@@ -3698,7 +3698,7 @@ int wc_BerToDer(const byte* ber, word32 berSz, byte* der, word32* derSz)
 
             /* Finish calculation of data length for indefinite item */
             IndefItems_CalcLength(indefItems);
-            /* Go to indefinte parent item */
+            /* Go to indefinite parent item */
             IndefItems_Up(indefItems);
         }
         else {
@@ -18746,7 +18746,7 @@ static int DecodeSubtreeGeneralName(const byte* input, int sz, byte tag,
 }
 #endif
 
-/* Decode a subtree of a name contraint in a certificate.
+/* Decode a subtree of a name constraints in a certificate.
  *
  * X.509: RFC 5280, 4.2.1.10 - Name Contraints.
  *

+ 6 - 6
wolfcrypt/src/evp.c

@@ -9245,7 +9245,7 @@ static int PrintPubKeyRSA(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
             nSz++;
         }
 
-        if (PrintHexWithColon(out, n, nSz, 
+        if (PrintHexWithColon(out, n, nSz,
                     indent + 4, 1/* lower case */) != WOLFSSL_SUCCESS) {
             break;
         }
@@ -9669,7 +9669,7 @@ static int PrintPubKeyDSA(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
         if (wolfSSL_BIO_write(out, line, (int)XSTRLEN(line)) <= 0) {
             break;
         }
-        if (PrintHexWithColon(out, y, ySz, indent + 4, 0/* upper case */) 
+        if (PrintHexWithColon(out, y, ySz, indent + 4, 0/* upper case */)
                                                         != WOLFSSL_SUCCESS) {
             break;
         }
@@ -9679,7 +9679,7 @@ static int PrintPubKeyDSA(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
         if (wolfSSL_BIO_write(out, line, (int)XSTRLEN(line)) <= 0) {
             break;
         }
-        if (PrintHexWithColon(out, p, pSz, indent + 4, 0/* upper case */) 
+        if (PrintHexWithColon(out, p, pSz, indent + 4, 0/* upper case */)
                                                         != WOLFSSL_SUCCESS) {
             break;
         }
@@ -9699,7 +9699,7 @@ static int PrintPubKeyDSA(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
         if (wolfSSL_BIO_write(out, line, (int)XSTRLEN(line)) <= 0) {
             break;
         }
-        if (PrintHexWithColon(out, g, gSz, indent + 4, 0/* upper case */) 
+        if (PrintHexWithColon(out, g, gSz, indent + 4, 0/* upper case */)
                                                         != WOLFSSL_SUCCESS) {
             break;
         }
@@ -9878,7 +9878,7 @@ static int PrintPubKeyDH(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
         if (wolfSSL_BIO_write(out, line, (int)XSTRLEN(line)) <= 0) {
             break;
         }
-        if (PrintHexWithColon(out, publicKey, 
+        if (PrintHexWithColon(out, publicKey,
                                 publicKeySz, indent + 4, 0/* upper case */)
                                                     != WOLFSSL_SUCCESS) {
             break;
@@ -9888,7 +9888,7 @@ static int PrintPubKeyDH(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
         if (wolfSSL_BIO_write(out, line, (int)XSTRLEN(line)) <= 0) {
             break;
         }
-        if (PrintHexWithColon(out, prime, primeSz, 
+        if (PrintHexWithColon(out, prime, primeSz,
                                             indent + 4, 0/* upper case */)
                 != WOLFSSL_SUCCESS) {
             break;

+ 2 - 2
wolfcrypt/src/tfm.c

@@ -3919,8 +3919,8 @@ int fp_set_int(fp_int *a, unsigned long b)
 #else
   fp_set (a, (fp_digit)b);
 #endif
-  
-  return FP_OKAY;  
+
+  return FP_OKAY;
 }
 
 /* check if a bit is set */