]> www.wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Sources formatting
authorDmitry Belyavskiy <beldmit@gmail.com>
Sat, 26 Mar 2016 14:03:38 +0000 (17:03 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Sat, 26 Mar 2016 14:03:38 +0000 (17:03 +0300)
e_gost_err.h
gost_asn1.c
gost_lcl.h
gost_md.c
gost_md2012.c

index e8a5f2877ba63740014a0ae5f8f09037ad3adeae..d0f7d8943a07c6e86760b5b585e896384e716b28 100644 (file)
@@ -64,9 +64,9 @@ extern "C" {
  * The following lines are auto generated by the script mkerr.pl. Any changes
  * made after this point may be overwritten when the script is next run.
  */
-void ERR_load_GOST_strings(void);
-void ERR_unload_GOST_strings(void);
-void ERR_GOST_error(int function, int reason, char *file, int line);
+    void ERR_load_GOST_strings(void);
+    void ERR_unload_GOST_strings(void);
+    void ERR_GOST_error(int function, int reason, char *file, int line);
 # define GOSTerr(f,r) ERR_GOST_error((f),(r),__FILE__,__LINE__)
 
 /* Error codes for the GOST functions. */
@@ -139,7 +139,7 @@ void ERR_GOST_error(int function, int reason, char *file, int line);
 # define GOST_R_UNSUPPORTED_CIPHER_CTL_COMMAND            126
 # define GOST_R_UNSUPPORTED_PARAMETER_SET                 127
 
-#ifdef  __cplusplus
+# ifdef  __cplusplus
 }
-#endif
+# endif
 #endif
index fb9792a7fbe5c9aad1eb028843b8269ae5c4eefb..3a106c2fc675409e7d5939a34ca30d956e4b2a24 100644 (file)
@@ -26,29 +26,29 @@ ASN1_NDEF_SEQUENCE_END(GOST_KEY_TRANSPORT)
     ASN1_SIMPLE(GOST_KEY_INFO, encrypted_key, ASN1_OCTET_STRING),
         ASN1_SIMPLE(GOST_KEY_INFO, imit, ASN1_OCTET_STRING)
 } ASN1_NDEF_SEQUENCE_END(GOST_KEY_INFO)
- IMPLEMENT_ASN1_FUNCTIONS(GOST_KEY_INFO)
- ASN1_NDEF_SEQUENCE(GOST_KEY_AGREEMENT_INFO) =
+IMPLEMENT_ASN1_FUNCTIONS(GOST_KEY_INFO)
+ASN1_NDEF_SEQUENCE(GOST_KEY_AGREEMENT_INFO) =
 {
     ASN1_SIMPLE(GOST_KEY_AGREEMENT_INFO, cipher, ASN1_OBJECT),
         ASN1_IMP_OPT(GOST_KEY_AGREEMENT_INFO, ephem_key, X509_PUBKEY, 0),
         ASN1_SIMPLE(GOST_KEY_AGREEMENT_INFO, eph_iv, ASN1_OCTET_STRING)
 } ASN1_NDEF_SEQUENCE_END(GOST_KEY_AGREEMENT_INFO)
- IMPLEMENT_ASN1_FUNCTIONS(GOST_KEY_AGREEMENT_INFO)
- ASN1_NDEF_SEQUENCE(GOST_KEY_PARAMS) =
+IMPLEMENT_ASN1_FUNCTIONS(GOST_KEY_AGREEMENT_INFO)
+ASN1_NDEF_SEQUENCE(GOST_KEY_PARAMS) =
 {
 ASN1_SIMPLE(GOST_KEY_PARAMS, key_params, ASN1_OBJECT),
         ASN1_SIMPLE(GOST_KEY_PARAMS, hash_params, ASN1_OBJECT),
         ASN1_OPT(GOST_KEY_PARAMS, cipher_params,
                      ASN1_OBJECT),} ASN1_NDEF_SEQUENCE_END(GOST_KEY_PARAMS)
- IMPLEMENT_ASN1_FUNCTIONS(GOST_KEY_PARAMS)
- ASN1_NDEF_SEQUENCE(GOST_CIPHER_PARAMS) =
+IMPLEMENT_ASN1_FUNCTIONS(GOST_KEY_PARAMS)
+ASN1_NDEF_SEQUENCE(GOST_CIPHER_PARAMS) =
 {
 ASN1_SIMPLE(GOST_CIPHER_PARAMS, iv, ASN1_OCTET_STRING),
         ASN1_SIMPLE(GOST_CIPHER_PARAMS, enc_param_set,
                         ASN1_OBJECT),}
 ASN1_NDEF_SEQUENCE_END(GOST_CIPHER_PARAMS)
- IMPLEMENT_ASN1_FUNCTIONS(GOST_CIPHER_PARAMS)
- ASN1_NDEF_SEQUENCE(GOST_CLIENT_KEY_EXCHANGE_PARAMS) =
+IMPLEMENT_ASN1_FUNCTIONS(GOST_CIPHER_PARAMS)
+ASN1_NDEF_SEQUENCE(GOST_CLIENT_KEY_EXCHANGE_PARAMS) =
 {                               /* FIXME incomplete */
     ASN1_SIMPLE(GOST_CLIENT_KEY_EXCHANGE_PARAMS, gkt, GOST_KEY_TRANSPORT)
 } ASN1_NDEF_SEQUENCE_END(GOST_CLIENT_KEY_EXCHANGE_PARAMS)
@@ -60,4 +60,4 @@ ASN1_NDEF_SEQUENCE_END(GOST_CIPHER_PARAMS)
     ASN1_SIMPLE(MASKED_GOST_KEY, masked_priv_key, ASN1_OCTET_STRING),
         ASN1_SIMPLE(MASKED_GOST_KEY, public_key, ASN1_OCTET_STRING)
 } ASN1_NDEF_SEQUENCE_END(MASKED_GOST_KEY)
- IMPLEMENT_ASN1_FUNCTIONS(MASKED_GOST_KEY)
+IMPLEMENT_ASN1_FUNCTIONS(MASKED_GOST_KEY)
index a82362f47e55f3cf8c382e12ee1c12ebd5e676a5..9dac7d4a486d208e01eef95ee2bc0764dcde652c 100644 (file)
@@ -205,10 +205,10 @@ extern struct gost_cipher_info gost_cipher_list[];
 /* Find encryption params from ASN1_OBJECT */
 const struct gost_cipher_info *get_encryption_params(ASN1_OBJECT *obj);
 /* Implementation of GOST 28147-89 cipher in CFB and CNT modes */
-const EVP_CIPHERcipher_gost();
-const EVP_CIPHERcipher_gost_cbc();
-const EVP_CIPHERcipher_gost_cpacnt();
-const EVP_CIPHERcipher_gost_cpcnt_12();
+const EVP_CIPHER *cipher_gost();
+const EVP_CIPHER *cipher_gost_cbc();
+const EVP_CIPHER *cipher_gost_cpacnt();
+const EVP_CIPHER *cipher_gost_cpcnt_12();
 void cipher_gost_destroy();
 # define EVP_MD_CTRL_KEY_LEN (EVP_MD_CTRL_ALG_CTRL+3)
 # define EVP_MD_CTRL_SET_KEY (EVP_MD_CTRL_ALG_CTRL+4)
index 54a2fe511f4912a12bb0b573c03edb32a76088c0..5d2c537a7acd95ef49f626490d71ce11014ed00d 100644 (file)
--- a/gost_md.c
+++ b/gost_md.c
@@ -30,7 +30,8 @@ EVP_MD *digest_gost(void)
             || !EVP_MD_meth_set_result_size(md, 32)
             || !EVP_MD_meth_set_input_blocksize(md, 32)
             || !EVP_MD_meth_set_app_datasize(md,
-                                             sizeof(struct ossl_gost_digest_ctx))
+                                             sizeof(struct
+                                                    ossl_gost_digest_ctx))
             || !EVP_MD_meth_set_init(md, gost_digest_init)
             || !EVP_MD_meth_set_update(md, gost_digest_update)
             || !EVP_MD_meth_set_final(md, gost_digest_final)
@@ -84,6 +85,7 @@ int gost_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
 int gost_digest_cleanup(EVP_MD_CTX *ctx)
 {
     if (EVP_MD_CTX_md_data(ctx))
-        memset(EVP_MD_CTX_md_data(ctx), 0, sizeof(struct ossl_gost_digest_ctx));
+        memset(EVP_MD_CTX_md_data(ctx), 0,
+               sizeof(struct ossl_gost_digest_ctx));
     return 1;
 }
index 52522ee4a8eff48b0fe4d380e9abd573fb488e72..712e0acd88a8db7e1fe8f7b501717a69450dd520 100644 (file)
@@ -35,7 +35,8 @@ EVP_MD *digest_gost2012_256(void)
     if (_hidden_GostR3411_2012_256_md == NULL) {
         EVP_MD *md;
 
-        if ((md = EVP_MD_meth_new(NID_id_GostR3411_2012_256, NID_undef)) == NULL
+        if ((md =
+             EVP_MD_meth_new(NID_id_GostR3411_2012_256, NID_undef)) == NULL
             || !EVP_MD_meth_set_result_size(md, 32)
             || !EVP_MD_meth_set_input_blocksize(md, 64)
             || !EVP_MD_meth_set_app_datasize(md, sizeof(gost2012_hash_ctx))
@@ -64,7 +65,8 @@ EVP_MD *digest_gost2012_512(void)
     if (_hidden_GostR3411_2012_512_md == NULL) {
         EVP_MD *md;
 
-        if ((md = EVP_MD_meth_new(NID_id_GostR3411_2012_512, NID_undef)) == NULL
+        if ((md =
+             EVP_MD_meth_new(NID_id_GostR3411_2012_512, NID_undef)) == NULL
             || !EVP_MD_meth_set_result_size(md, 64)
             || !EVP_MD_meth_set_input_blocksize(md, 64)
             || !EVP_MD_meth_set_app_datasize(md, sizeof(gost2012_hash_ctx))
@@ -90,19 +92,22 @@ void digest_gost2012_512_destroy(void)
 
 static int gost_digest_init512(EVP_MD_CTX *ctx)
 {
-    init_gost2012_hash_ctx((gost2012_hash_ctx *) EVP_MD_CTX_md_data(ctx), 512);
+    init_gost2012_hash_ctx((gost2012_hash_ctx *) EVP_MD_CTX_md_data(ctx),
+                           512);
     return 1;
 }
 
 static int gost_digest_init256(EVP_MD_CTX *ctx)
 {
-    init_gost2012_hash_ctx((gost2012_hash_ctx *) EVP_MD_CTX_md_data(ctx), 256);
+    init_gost2012_hash_ctx((gost2012_hash_ctx *) EVP_MD_CTX_md_data(ctx),
+                           256);
     return 1;
 }
 
 static int gost_digest_update(EVP_MD_CTX *ctx, const void *data, size_t count)
 {
-    gost2012_hash_block((gost2012_hash_ctx *) EVP_MD_CTX_md_data(ctx), data, count);
+    gost2012_hash_block((gost2012_hash_ctx *) EVP_MD_CTX_md_data(ctx), data,
+                        count);
     return 1;
 }
 
@@ -115,7 +120,8 @@ static int gost_digest_final(EVP_MD_CTX *ctx, unsigned char *md)
 static int gost_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
 {
     if (EVP_MD_CTX_md_data(to) && EVP_MD_CTX_md_data(from))
-        memcpy(EVP_MD_CTX_md_data(to), EVP_MD_CTX_md_data(from), sizeof(gost2012_hash_ctx));
+        memcpy(EVP_MD_CTX_md_data(to), EVP_MD_CTX_md_data(from),
+               sizeof(gost2012_hash_ctx));
 
     return 1;
 }