Spelling... and more spelling

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1245)
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c
index 42a0278..ea1e3d5 100644
--- a/ssl/d1_lib.c
+++ b/ssl/d1_lib.c
@@ -278,7 +278,7 @@
 
     /*
      * If remaining time is less than 15 ms, set it to 0 to prevent issues
-     * because of small devergences with socket timeouts.
+     * because of small divergences with socket timeouts.
      */
     if (timeleft->tv_sec == 0 && timeleft->tv_usec < 15000) {
         memset(timeleft, 0, sizeof(*timeleft));
@@ -952,7 +952,7 @@
 
     /*-
      * Create HeartBeat message, we just use a sequence number
-     * as payload to distuingish different messages and add
+     * as payload to distinguish different messages and add
      * some random stuff.
      */
     size = HEARTBEAT_SIZE(payload, padding);
diff --git a/ssl/ssl_conf.c b/ssl/ssl_conf.c
index 7b462aa..890b0af 100644
--- a/ssl/ssl_conf.c
+++ b/ssl/ssl_conf.c
@@ -14,7 +14,7 @@
 #include <openssl/dh.h>
 
 /*
- * structure holding name tables. This is used for pemitted elements in lists
+ * structure holding name tables. This is used for permitted elements in lists
  * such as TLSv1.
  */
 
diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c
index 5741bb8..1b1f4bc 100644
--- a/ssl/ssl_err.c
+++ b/ssl/ssl_err.c
@@ -443,8 +443,8 @@
     {ERR_REASON(SSL_R_NO_RENEGOTIATION), "no renegotiation"},
     {ERR_REASON(SSL_R_NO_REQUIRED_DIGEST), "no required digest"},
     {ERR_REASON(SSL_R_NO_SHARED_CIPHER), "no shared cipher"},
-    {ERR_REASON(SSL_R_NO_SHARED_SIGATURE_ALGORITHMS),
-     "no shared sigature algorithms"},
+    {ERR_REASON(SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS),
+     "no shared signature algorithms"},
     {ERR_REASON(SSL_R_NO_SRTP_PROFILES), "no srtp profiles"},
     {ERR_REASON(SSL_R_NO_VALID_SCTS), "no valid scts"},
     {ERR_REASON(SSL_R_NO_VERIFY_COOKIE_CALLBACK),
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 359260e..08e3673 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -2041,7 +2041,7 @@
  * is indicated to the callback. In this case, the client application has to
  * abort the connection or have a default application level protocol. 2) If
  * the server supports NPN, but advertises an empty list then the client
- * selects the first protcol in its list, but indicates via the API that this
+ * selects the first protocol in its list, but indicates via the API that this
  * fallback case was enacted. 3) Otherwise, the client finds the first
  * protocol in the server's list that it supports and selects this protocol.
  * This is because it's assumed that the server has better information about
@@ -4116,7 +4116,7 @@
      * value is negative.
      *
      * XXX: One might well argue that the return value of this function is an
-     * unforunate design choice.  Its job is only to determine the validation
+     * unfortunate design choice.  Its job is only to determine the validation
      * status of each of the provided SCTs.  So long as it correctly separates
      * the wheat from the chaff it should return success.  Failure in this case
      * ought to correspond to an inability to carry out its duties.
diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c
index 920a178..124a53c 100644
--- a/ssl/t1_enc.c
+++ b/ssl/t1_enc.c
@@ -141,7 +141,7 @@
             goto err;
         else
             /*
-             * make sure it's intialized in case we exit later with an error
+             * make sure it's initialised in case we exit later with an error
              */
             EVP_CIPHER_CTX_reset(s->enc_read_ctx);
         dd = s->enc_read_ctx;
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
index 3e5e9fb..3e27d65 100644
--- a/ssl/t1_lib.c
+++ b/ssl/t1_lib.c
@@ -2648,7 +2648,7 @@
         /* Fatal error is no shared signature algorithms */
         if (!s->cert->shared_sigalgs) {
             SSLerr(SSL_F_TLS1_SET_SERVER_SIGALGS,
-                   SSL_R_NO_SHARED_SIGATURE_ALGORITHMS);
+                   SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS);
             al = SSL_AD_ILLEGAL_PARAMETER;
             goto err;
         }