diff options
-rw-r--r-- | sbin/isakmpd/key.c | 13 | ||||
-rw-r--r-- | sbin/isakmpd/key.h | 4 |
2 files changed, 13 insertions, 4 deletions
diff --git a/sbin/isakmpd/key.c b/sbin/isakmpd/key.c index d19d6715552..b542b13a7fb 100644 --- a/sbin/isakmpd/key.c +++ b/sbin/isakmpd/key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key.c,v 1.8 2002/03/06 10:02:32 ho Exp $ */ +/* $OpenBSD: key.c,v 1.9 2002/03/06 13:55:12 ho Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -124,7 +124,7 @@ key_printable (int type, int private, u_int8_t *data, int datalen) /* Convert from serialized to internal. */ void * -key_internalize (int type, int private, const u_int8_t *data, int datalen) +key_internalize (int type, int private, u_int8_t *data, int datalen) { switch (type) { @@ -133,10 +133,19 @@ key_internalize (int type, int private, const u_int8_t *data, int datalen) case ISAKMP_KEY_RSA: switch (private) { +#if OPENSSL_VERSION_NUMBER >= 0x00907000L + case ISAKMP_KEYTYPE_PUBLIC: + return LC (d2i_RSAPublicKey, (NULL, (const u_int8_t **)&data, + datalen)); + case ISAKMP_KEYTYPE_PRIVATE: + return LC (d2i_RSAPrivateKey, (NULL, (const u_int8_t **)&data, + datalen)); +#else case ISAKMP_KEYTYPE_PUBLIC: return LC (d2i_RSAPublicKey, (NULL, &data, datalen)); case ISAKMP_KEYTYPE_PRIVATE: return LC (d2i_RSAPrivateKey, (NULL, &data, datalen)); +#endif default: log_error ("key_internalize: not public or private RSA key passed"); return 0; diff --git a/sbin/isakmpd/key.h b/sbin/isakmpd/key.h index 790313d5897..711d9783dbb 100644 --- a/sbin/isakmpd/key.h +++ b/sbin/isakmpd/key.h @@ -1,4 +1,4 @@ -/* $OpenBSD: key.h,v 1.4 2002/03/05 00:10:43 deraadt Exp $ */ +/* $OpenBSD: key.h,v 1.5 2002/03/06 13:55:12 ho Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -35,5 +35,5 @@ void key_free (int, int, void *); void key_serialize (int, int, void *, u_int8_t **, size_t *); char *key_printable (int, int, u_int8_t *, int); void key_from_printable (int, int, char *, u_int8_t **, int *); -void *key_internalize (int, int, const u_int8_t *, int); +void *key_internalize (int, int, u_int8_t *, int); #endif /* _KEY_H_ */ |