Fix various warnings.
This commit is contained in:
parent
cf32ad7fe3
commit
84948b39df
@ -118,7 +118,7 @@ struct dsa_method
|
||||
int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
|
||||
BIGNUM **rp);
|
||||
int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len,
|
||||
DSA_SIG *sig, DSA *dsa);
|
||||
DSA_SIG *sig, DSA *dsa);
|
||||
int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1,
|
||||
BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx,
|
||||
BN_MONT_CTX *in_mont);
|
||||
|
@ -68,7 +68,7 @@
|
||||
static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
|
||||
static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
|
||||
static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
|
||||
DSA *dsa);
|
||||
DSA *dsa);
|
||||
static int dsa_init(DSA *dsa);
|
||||
static int dsa_finish(DSA *dsa);
|
||||
|
||||
@ -291,7 +291,7 @@ err:
|
||||
}
|
||||
|
||||
static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
|
||||
DSA *dsa)
|
||||
DSA *dsa)
|
||||
{
|
||||
BN_CTX *ctx;
|
||||
BIGNUM u1,u2,t1;
|
||||
|
@ -62,9 +62,6 @@
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/x509.h>
|
||||
|
||||
extern int obj_cleanup_defer;
|
||||
extern void check_defer(int nid);
|
||||
|
||||
int EVP_add_cipher(const EVP_CIPHER *c)
|
||||
{
|
||||
int r;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "e_gost_err.h"
|
||||
#include "gost_keywrap.h"
|
||||
#include "gost_lcl.h"
|
||||
#include "gost2001_keyx.h"
|
||||
|
||||
/* Transform ECDH shared key into little endian as required by Cryptocom
|
||||
* key exchange */
|
||||
|
10
engines/ccgost/gost2001_keyx.h
Normal file
10
engines/ccgost/gost2001_keyx.h
Normal file
@ -0,0 +1,10 @@
|
||||
GOST_KEY_TRANSPORT *
|
||||
make_rfc4490_keytransport_2001(EVP_PKEY *pubk, BIGNUM *eph_key,
|
||||
const unsigned char *key, size_t keylen,
|
||||
unsigned char *ukm, size_t ukm_len);
|
||||
|
||||
int decrypt_rfc4490_shared_key_2001(EVP_PKEY *priv,
|
||||
GOST_KEY_TRANSPORT *gkt,
|
||||
unsigned char *key_buf,
|
||||
int key_buf_len) ;
|
||||
|
@ -114,7 +114,7 @@ const byte CryptoProKeyMeshingKey[]={
|
||||
0xC0, 0x86, 0xDC, 0xC2, 0xEF, 0x4C, 0xA9, 0x2B
|
||||
};
|
||||
/* Initialization of gost_ctx subst blocks*/
|
||||
void kboxinit(gost_ctx *c, const gost_subst_block *b)
|
||||
static void kboxinit(gost_ctx *c, const gost_subst_block *b)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -98,11 +98,13 @@ static int decode_gost_algor_params(EVP_PKEY *pkey, X509_ALGOR *palg)
|
||||
ASN1_OBJECT *palg_obj =NULL;
|
||||
int ptype = V_ASN1_UNDEF;
|
||||
int pkey_nid = NID_undef,param_nid = NID_undef;
|
||||
void *_pval;
|
||||
ASN1_STRING *pval = NULL;
|
||||
const unsigned char *p;
|
||||
GOST_KEY_PARAMS *gkp = NULL;
|
||||
|
||||
X509_ALGOR_get0(&palg_obj, &ptype, (void **) (&pval), palg);
|
||||
X509_ALGOR_get0(&palg_obj, &ptype, &_pval, palg);
|
||||
pval = _pval;
|
||||
if (ptype != V_ASN1_SEQUENCE)
|
||||
{
|
||||
GOSTerr(GOST_F_DECODE_GOST_ALGOR_PARAMS,
|
||||
|
@ -197,7 +197,7 @@ const struct gost_cipher_info *get_encryption_params(ASN1_OBJECT *obj)
|
||||
}
|
||||
|
||||
/* Sets cipher param from paramset NID. */
|
||||
int gost_cipher_set_param(struct ossl_gost_cipher_ctx *c,int nid)
|
||||
static int gost_cipher_set_param(struct ossl_gost_cipher_ctx *c,int nid)
|
||||
{
|
||||
const struct gost_cipher_info *param;
|
||||
param=get_encryption_params((nid==NID_undef?NULL:OBJ_nid2obj(nid)));
|
||||
@ -226,8 +226,9 @@ static int gost_cipher_init_param(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef USE_SSL
|
||||
/* Initializes EVP_CIPHER_CTX with fixed cryptopro A paramset */
|
||||
int gost_cipher_init_cpa(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
static int gost_cipher_init_cpa(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
const unsigned char *iv, int enc)
|
||||
{
|
||||
struct ossl_gost_cipher_ctx *c=ctx->cipher_data;
|
||||
@ -241,7 +242,7 @@ int gost_cipher_init_cpa(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
}
|
||||
|
||||
/* Initializes EVP_CIPHER_CTX with fixed vizir paramset */
|
||||
int gost_cipher_init_vizir(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
static int gost_cipher_init_vizir(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
const unsigned char *iv, int enc)
|
||||
{
|
||||
struct ossl_gost_cipher_ctx *c=ctx->cipher_data;
|
||||
@ -254,6 +255,7 @@ int gost_cipher_init_vizir(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx));
|
||||
return 1;
|
||||
}
|
||||
#endif /* def USE_SSL */
|
||||
|
||||
/* Initializes EVP_CIPHER_CTX with default values */
|
||||
int gost_cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
@ -275,6 +277,7 @@ static void gost_crypt_mesh (void *ctx,unsigned char *iv,unsigned char *buf)
|
||||
c->count+=8;
|
||||
}
|
||||
|
||||
#ifdef USE_SSL
|
||||
static void gost_cnt_next (void *ctx, unsigned char *iv, unsigned char *buf)
|
||||
{
|
||||
struct ossl_gost_cipher_ctx *c = ctx;
|
||||
@ -305,6 +308,7 @@ static void gost_cnt_next (void *ctx, unsigned char *iv, unsigned char *buf)
|
||||
gostcrypt(&(c->cctx),buf1,buf);
|
||||
c->count +=8;
|
||||
}
|
||||
#endif /* def USE_SSL */
|
||||
|
||||
/* GOST encryption in CFB mode */
|
||||
int gost_cipher_do_cfb(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
@ -369,7 +373,8 @@ int gost_cipher_do_cfb(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
return 1;
|
||||
}
|
||||
|
||||
int gost_cipher_do_cnt(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
#if USE_SSL
|
||||
static int gost_cipher_do_cnt(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
const unsigned char *in, unsigned int inl)
|
||||
{
|
||||
const unsigned char *in_ptr=in;
|
||||
@ -422,6 +427,7 @@ int gost_cipher_do_cnt(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif /* def USE_SSL */
|
||||
|
||||
/* Cleaning up of EVP_CIPHER_CTX */
|
||||
int gost_cipher_cleanup(EVP_CIPHER_CTX *ctx)
|
||||
|
@ -141,8 +141,10 @@ static int bind_gost (ENGINE *e,const char *id)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef ENGINE_DYNAMIC_SUPPORT
|
||||
IMPLEMENT_DYNAMIC_BIND_FN(bind_gost)
|
||||
IMPLEMENT_DYNAMIC_CHECK_FN()
|
||||
#endif /* def ENGINE_DYNAMIC_SUPPORT */
|
||||
|
||||
static int gost_digests(ENGINE *e, const EVP_MD **digest,
|
||||
const int **nids, int nid)
|
||||
|
Loading…
Reference in New Issue
Block a user