]> www.wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Fix compiler warnings
authorMouse <mouse008@gmail.com>
Tue, 27 Jun 2017 22:32:32 +0000 (18:32 -0400)
committerMouse <mouse008@gmail.com>
Tue, 27 Jun 2017 22:32:32 +0000 (18:32 -0400)
gost12sum.c
gost_ameth.c
gost_ec_keyx.c
gost_grasshopper_cipher.c

index d6a50ed2676bcd5198d8e6b8c78a532fd822f4e3..f59bc05e4c2f1e43f080e34f7f2b10f28a7662cb 100644 (file)
@@ -216,7 +216,7 @@ int hash_stream(gost_hash_ctx * ctx, int fd, char *sum)
     unsigned char buffer[BUF_SIZE];
     unsigned char reverted_buffer[BUF_SIZE];
     ssize_t bytes;
-    int i, j, k;
+
     start_hash12(ctx);
     while ((bytes = read(fd, buffer, BUF_SIZE)) > 0) {
         hash12_block(ctx, reverted_buffer, bytes);
@@ -225,7 +225,7 @@ int hash_stream(gost_hash_ctx * ctx, int fd, char *sum)
         return 0;
     }
     finish_hash12(ctx, buffer);
-    for (i = 0; i < (hashsize / 8); i++) {
+    for (size_t i = 0; i < (hashsize / 8); i++) {
         sprintf(sum + 2 * i, "%02x", buffer[i]);
     }
     return 1;
index b2333a4ea6cc32c348122f59489b0dd9894eaaec..005fbf7257a960113fb82f8a3cdef7a42861a1d8 100644 (file)
@@ -641,11 +641,11 @@ static int pub_decode_gost_ec(EVP_PKEY *pk, X509_PUBKEY *pub)
     const unsigned char *pubkey_buf = NULL;
     unsigned char *databuf;
     ASN1_OBJECT *palgobj = NULL;
-    int pub_len, i, j;
+    int pub_len;
     EC_POINT *pub_key;
     BIGNUM *X, *Y;
     ASN1_OCTET_STRING *octet = NULL;
-    int len;
+    size_t len;
     const EC_GROUP *group;
 
     if (!X509_PUBKEY_get0_param(&palgobj, &pubkey_buf, &pub_len, &palg, pub))
@@ -698,8 +698,8 @@ static int pub_encode_gost_ec(X509_PUBKEY *pub, const EVP_PKEY *pk)
     ASN1_OBJECT *algobj = NULL;
     ASN1_OCTET_STRING *octet = NULL;
     void *pval = NULL;
-    unsigned char *buf = NULL, *databuf = NULL, *sptr;
-    int i, j, data_len, ret = -1;
+    unsigned char *buf = NULL, *databuf = NULL;
+    int data_len, ret = -1;
     const EC_POINT *pub_key;
     BIGNUM *X = NULL, *Y = NULL, *order = NULL;
     const EC_KEY *ec = EVP_PKEY_get0((EVP_PKEY *)pk);
index 0684676797be695a97ec37b66f81d281b4662724..30d8e5847f8f30ed04061979903b520350b76ec3 100644 (file)
@@ -26,7 +26,6 @@ static int VKO_compute_key(unsigned char *shared_key, size_t shared_key_size,
     BIGNUM *UKM = NULL, *p = NULL, *order = NULL, *X = NULL, *Y = NULL;
     const BIGNUM *key = EC_KEY_get0_private_key(priv_key);
     EC_POINT *pnt = EC_POINT_new(EC_KEY_get0_group(priv_key));
-    int i;
     BN_CTX *ctx = BN_CTX_new();
     EVP_MD_CTX *mdctx = NULL;
     const EVP_MD *md = NULL;
index b33fe53dca4ba3f7a2fdf24e3ebf5f84f80965b7..23ba575a66d424bcd56420992f285deda77a7b40 100644 (file)
@@ -526,7 +526,6 @@ int gost_grasshopper_cipher_cleanup(EVP_CIPHER_CTX* ctx) {
 int gost_grasshopper_set_asn1_parameters(EVP_CIPHER_CTX* ctx, ASN1_TYPE* params) {
     int len = 0;
     unsigned char* buf = NULL;
-    unsigned char* p = NULL;
     ASN1_OCTET_STRING* os = NULL;
 
     os = ASN1_OCTET_STRING_new();