Hi,

Not a comprehensive review, but a couple of teeny things I noticed ..

On Sun, Dec 18, 2016 at 11:33 AM, Steffan Karger <stef...@karger.me> wrote:

in crypto.c

@@ -1389,13 +1396,15 @@ read_key_file(struct key2 *key2, const char *file,
> const unsigned int flags)
>      {
>          if (!key2->n)
>          {
> -            msg(M_FATAL, "Insufficient key material or header text not
> found in file '%s' (%d/%d/%d bytes found/min/m
> ax)",
> +            msg(M_FATAL,
> +                "Insufficient key material or header text not found in
> file '%s' (%d/%d/%d bytes found/min/max)",
>                  error_filename, count, onekeylen, keylen);
>          }
>
>          if (state != PARSE_FINISHED)
>          {
> -            msg(M_FATAL, "Footer text not found in file '%s' (%d/%d/%d
> bytes found/min/max)",
>

wrong indent :)


> +           msg(M_FATAL,
> +                "Footer text not found in file '%s' (%d/%d/%d bytes
> found/min/max)",
>                  error_filename, count, onekeylen, keylen);
>          }
>      }
>


In cryptoapi.c

@@ -290,7 +305,8 @@ rsa_priv_enc(int flen, const unsigned char *from,
> unsigned char *to, RSA *rsa, i
>
>  /* decrypt */
>  static int
> -rsa_priv_dec(int flen, const unsigned char *from, unsigned char *to, RSA
> *rsa, int padding)
> +rsa_priv_dec(int flen, const unsigned char *from, unsigned char *to, RSA
> *rsa,
> +        int padding)
>  {
>      /* I haven't been able to trigger this one, but I want to know if it
> happens... */
>      assert(0);
>

following this there is a

static int init(RSA *rsa)

which appears unused (at least mingw always complains so)
Can it be removed?

> @@ -509,7 +534,7 @@ SSL_CTX_use_CryptoAPI_certificate(SSL_CTX *ssl_ctx,
const char *cert_prop)
>         goto err;
>   }
>    /* SSL_CTX_use_RSAPrivateKey() increased the reference count in 'rsa',
so
>-  * we decrease it here with RSA_free(), or it will never be cleaned up.
*/
>+   * we decrease it here with RSA_free(), or it will never be cleaned up.
*/

Add a new line before the closing */ ?

Further, cryptoapi.c has a few for loops with opening brace on same line as
for, those could be wrapped with a new line?

Otherwise all look "safe and good" white space changes.

Selva
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to