diff options
author | 2014-06-10 12:56:39 +0000 | |
---|---|---|
committer | 2014-06-10 12:56:39 +0000 | |
commit | 9551ab2201b3aa9309970fe40772e6911441b7e4 (patch) | |
tree | 97f6d5d05d8209836e9331c36edc6071cb0b87e5 /lib/libssl/src/ssl/s3_enc.c | |
parent | add ppb to the configs as suggested by kettenis@ (diff) | |
download | wireguard-openbsd-9551ab2201b3aa9309970fe40772e6911441b7e4.tar.xz wireguard-openbsd-9551ab2201b3aa9309970fe40772e6911441b7e4.zip |
More KNF.
Diffstat (limited to 'lib/libssl/src/ssl/s3_enc.c')
-rw-r--r-- | lib/libssl/src/ssl/s3_enc.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/lib/libssl/src/ssl/s3_enc.c b/lib/libssl/src/ssl/s3_enc.c index 13ba633f492..c934e04eea5 100644 --- a/lib/libssl/src/ssl/s3_enc.c +++ b/lib/libssl/src/ssl/s3_enc.c @@ -5,21 +5,21 @@ * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. - * + * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * + * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -34,10 +34,10 @@ * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from + * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * + * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -49,7 +49,7 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * + * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence @@ -63,7 +63,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -189,18 +189,18 @@ ssl3_generate_key_block(SSL *s, unsigned char *km, int num) EVP_DigestInit_ex(&s1, EVP_sha1(), NULL); EVP_DigestUpdate(&s1, buf, k); EVP_DigestUpdate(&s1, s->session->master_key, - s->session->master_key_length); + s->session->master_key_length); EVP_DigestUpdate(&s1, s->s3->server_random, SSL3_RANDOM_SIZE); EVP_DigestUpdate(&s1, s->s3->client_random, SSL3_RANDOM_SIZE); EVP_DigestFinal_ex(&s1, smd, NULL); EVP_DigestInit_ex(&m5, EVP_md5(), NULL); EVP_DigestUpdate(&m5, s->session->master_key, - s->session->master_key_length); + s->session->master_key_length); EVP_DigestUpdate(&m5, smd, SHA_DIGEST_LENGTH); if ((int)(i + MD5_DIGEST_LENGTH) > num) { EVP_DigestFinal_ex(&m5, smd, NULL); - memcpy(km, smd,(num - i)); + memcpy(km, smd, (num - i)); } else EVP_DigestFinal_ex(&m5, km, NULL); @@ -367,7 +367,7 @@ ssl3_change_cipher_state(SSL *s, int which) } } - EVP_CipherInit_ex(dd, c, NULL, key, iv,(which & SSL3_CC_WRITE)); + EVP_CipherInit_ex(dd, c, NULL, key, iv, (which & SSL3_CC_WRITE)); OPENSSL_cleanse(&(exp_key[0]), sizeof(exp_key)); OPENSSL_cleanse(&(exp_iv[0]), sizeof(exp_iv)); @@ -454,7 +454,7 @@ ssl3_cleanup_key_block(SSL *s) { if (s->s3->tmp.key_block != NULL) { OPENSSL_cleanse(s->s3->tmp.key_block, - s->s3->tmp.key_block_length); + s->s3->tmp.key_block_length); free(s->s3->tmp.key_block); s->s3->tmp.key_block = NULL; } @@ -495,8 +495,7 @@ ssl3_enc(SSL *s, int send) enc = EVP_CIPHER_CTX_cipher(s->enc_read_ctx); } - if ((s->session == NULL) || (ds == NULL) || - (enc == NULL)) { + if ((s->session == NULL) || (ds == NULL) || (enc == NULL)) { memmove(rec->data, rec->input, rec->length); rec->input = rec->data; } else { @@ -565,7 +564,7 @@ ssl3_finish_mac(SSL *s, const unsigned char *buf, int len) { if (s->s3->handshake_buffer && !(s->s3->flags & TLS1_FLAGS_KEEP_HANDSHAKE)) { - BIO_write (s->s3->handshake_buffer,(void *)buf, len); + BIO_write(s->s3->handshake_buffer, (void *)buf, len); } else { int i; for (i = 0; i < SSL_MAX_DIGEST; i++) { @@ -678,13 +677,13 @@ ssl3_handshake_mac(SSL *s, int md_nid, const char *sender, int len, if (sender != NULL) EVP_DigestUpdate(&ctx, sender, len); EVP_DigestUpdate(&ctx, s->session->master_key, - s->session->master_key_length); + s->session->master_key_length); EVP_DigestUpdate(&ctx, ssl3_pad_1, npad); EVP_DigestFinal_ex(&ctx, md_buf, &i); EVP_DigestInit_ex(&ctx, EVP_MD_CTX_md(&ctx), NULL); EVP_DigestUpdate(&ctx, s->session->master_key, - s->session->master_key_length); + s->session->master_key_length); EVP_DigestUpdate(&ctx, ssl3_pad_2, npad); EVP_DigestUpdate(&ctx, md_buf, i); EVP_DigestFinal_ex(&ctx, p, &ret); @@ -822,9 +821,9 @@ ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, EVP_DigestUpdate(&ctx, salt[i], strlen((const char *)salt[i])); EVP_DigestUpdate(&ctx, p, len); EVP_DigestUpdate(&ctx, &(s->s3->client_random[0]), - SSL3_RANDOM_SIZE); + SSL3_RANDOM_SIZE); EVP_DigestUpdate(&ctx, &(s->s3->server_random[0]), - SSL3_RANDOM_SIZE); + SSL3_RANDOM_SIZE); EVP_DigestFinal_ex(&ctx, buf, &n); EVP_DigestInit_ex(&ctx, s->ctx->md5, NULL); |