From 9a6e264175ddbff3b5c1adb57b5d3ebf67084823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 30 Dec 2007 18:30:26 +0000 Subject: [PATCH] more doxygen. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22384 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hcrypto/dh.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/hcrypto/dh.c b/lib/hcrypto/dh.c index a6a5c2ff9..a6c5fd48c 100644 --- a/lib/hcrypto/dh.c +++ b/lib/hcrypto/dh.c @@ -183,6 +183,18 @@ DH_size(const DH *dh) return BN_num_bytes(dh->p); } +/** + * Set the data index idx in the DH object to data. + * + * @param dh DH object. + * @param idx index to set the data for. + * @param data data to store for the index idx. + * + * @return 1 on success. + * + * @ingroup hcrypto_dh + */ + int DH_set_ex_data(DH *dh, int idx, void *data) { @@ -190,6 +202,17 @@ DH_set_ex_data(DH *dh, int idx, void *data) return 1; } +/** + * Get the data for index idx in the DH object. + * + * @param dh DH object. + * @param idx index to get the data for. + * + * @return the object store in index idx + * + * @ingroup hcrypto_dh + */ + void * DH_get_ex_data(DH *dh, int idx) { @@ -338,6 +361,11 @@ DH_compute_key(unsigned char *shared_key, { int codes; + /** + * Checks that the pubkey passed in is valid using + * dh_check_pubkey(). + */ + if (!DH_check_pubkey(dh, peer_pub_key, &codes) || codes != 0) return -1;