projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make things static that should be. Declare stuff in headers that should be.
[openssl.git]
/
crypto
/
dh
/
dh_ameth.c
diff --git
a/crypto/dh/dh_ameth.c
b/crypto/dh/dh_ameth.c
index 6d3125789d4d8c5577a166ad0e4abf19f05f3bfd..0ff0fe7f3bc4d5100d4497808f94285d74733d43 100644
(file)
--- a/
crypto/dh/dh_ameth.c
+++ b/
crypto/dh/dh_ameth.c
@@
-287,7
+287,7
@@
err:
static void update_buflen(const BIGNUM *b, size_t *pbuflen)
{
static void update_buflen(const BIGNUM *b, size_t *pbuflen)
{
-
in
t i;
+
size_
t i;
if (!b)
return;
if (*pbuflen < (i = (size_t)BN_num_bytes(b)))
if (!b)
return;
if (*pbuflen < (i = (size_t)BN_num_bytes(b)))
@@
-381,7
+381,7
@@
static int do_dh_print(BIO *bp, const DH *x, int indent,
if (0)
{
err:
if (0)
{
err:
- DHerr(DH_F_D
HPARAMS
_PRINT,reason);
+ DHerr(DH_F_D
O_DH
_PRINT,reason);
}
if (m != NULL) OPENSSL_free(m);
return(ret);
}
if (m != NULL) OPENSSL_free(m);
return(ret);
@@
-397,6
+397,15
@@
static int dh_bits(const EVP_PKEY *pkey)
return BN_num_bits(pkey->pkey.dh->p);
}
return BN_num_bits(pkey->pkey.dh->p);
}
+static int dh_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b)
+ {
+ if ( BN_cmp(a->pkey.dh->p,b->pkey.dh->p) ||
+ BN_cmp(a->pkey.dh->g,b->pkey.dh->g))
+ return 0;
+ else
+ return 1;
+ }
+
static int dh_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from)
{
BIGNUM *a;
static int dh_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from)
{
BIGNUM *a;
@@
-409,20
+418,18
@@
static int dh_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from)
if ((a=BN_dup(from->pkey.dh->g)) == NULL)
return 0;
if ((a=BN_dup(from->pkey.dh->g)) == NULL)
return 0;
- if (to->pkey.d
sa
->g != NULL)
+ if (to->pkey.d
h
->g != NULL)
BN_free(to->pkey.dh->g);
to->pkey.dh->g=a;
return 1;
}
BN_free(to->pkey.dh->g);
to->pkey.dh->g=a;
return 1;
}
-static int dh_
cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b
)
+static int dh_
missing_parameters(const EVP_PKEY *a
)
{
{
- if ( BN_cmp(a->pkey.dh->p,b->pkey.dsa->p) ||
- BN_cmp(a->pkey.dh->g,b->pkey.dsa->g))
- return 0;
- else
+ if (!a->pkey.dh->p || !a->pkey.dh->g)
return 1;
return 1;
+ return 0;
}
static int dh_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
}
static int dh_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
@@
-481,7
+488,7
@@
const EVP_PKEY_ASN1_METHOD dh_asn1_meth =
dh_param_decode,
dh_param_encode,
dh_param_decode,
dh_param_encode,
-
0
,
+
dh_missing_parameters
,
dh_copy_parameters,
dh_cmp_parameters,
dh_param_print,
dh_copy_parameters,
dh_cmp_parameters,
dh_param_print,