along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol_key.c,v 1.2 2002/04/09 15:26:01 zarq Exp $
+ $Id: protocol_key.c,v 1.3 2002/04/28 12:46:26 zarq Exp $
*/
#include "config.h"
bin2hex(from->key, key, from->keylength);
key[from->keylength * 2] = '\0';
cp
+#ifdef USE_OPENSSL
return send_request(c, "%d %s %s %s %d %d %d %d", ANS_KEY,
from->name, to->name, key, from->cipher?from->cipher->nid:0, from->digest?from->digest->type:0, from->maclength, from->compression);
+#endif
+#ifdef USE_GCRYPT
+ return send_request(c, "%d %s %s %s %d %d %d %d", ANS_KEY,
+ from->name, to->name, key, from->cipher?-1:0, from->digest?-1:0, from->maclength, from->compression);
+#endif
}
int ans_key_h(connection_t *c)
if(cipher)
{
+#ifdef USE_OPENSSL
from->cipher = EVP_get_cipherbynid(cipher);
if(!from->cipher)
{
syslog(LOG_ERR, _("Node %s (%s) uses wrong keylength!"), from->name, from->hostname);
return -1;
}
+#endif
}
else
{
if(digest)
{
+#ifdef USE_OPENSSL
from->digest = EVP_get_digestbynid(digest);
if(!from->digest)
{
syslog(LOG_ERR, _("Node %s (%s) uses bogus MAC length!"), from->name, from->hostname);
return -1;
}
+#endif
}
else
{