diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2000-01-30 20:52:21 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2000-01-30 20:52:21 +0000 |
commit | 2832f3107028a1d364e34603bd1431c6ce72346c (patch) | |
tree | f93540cfc2a4bbac6d9381cb7277c3dd2df802a8 | |
parent | d84dfca7d86a8fd02edb4cfb8d6ee60f1f887881 (diff) |
Merge with EOM 1.107
author: angelos
Fix part of the problem with X509 certificates (delegating to the CA
isn't working yet, but I know where the problem is -- upcoming commit
later today).
-rw-r--r-- | sbin/isakmpd/ike_quick_mode.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/sbin/isakmpd/ike_quick_mode.c b/sbin/isakmpd/ike_quick_mode.c index 974195f18b5..4f8c78cd3e5 100644 --- a/sbin/isakmpd/ike_quick_mode.c +++ b/sbin/isakmpd/ike_quick_mode.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ike_quick_mode.c,v 1.24 2000/01/26 15:22:02 niklas Exp $ */ -/* $EOM: ike_quick_mode.c,v 1.106 2000/01/24 22:55:46 angelos Exp $ */ +/* $OpenBSD: ike_quick_mode.c,v 1.25 2000/01/30 20:52:20 niklas Exp $ */ +/* $EOM: ike_quick_mode.c,v 1.107 2000/01/30 20:17:47 angelos Exp $ */ /* * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. @@ -107,8 +107,8 @@ static int check_policy (struct exchange *exchange, struct sa *sa, struct sa *isakmp_sa) { char *return_values[RETVALUES_NUM]; + char *principal = NULL, *princ2; struct keynote_deckey dc; - char *principal = NULL; int result; RSA *key; @@ -156,8 +156,26 @@ check_policy (struct exchange *exchange, struct sa *sa, struct sa *isakmp_sa) if (LKV (keynote_errno) == ERROR_MEMORY) log_fatal ("check_policy: failed to get memory for public key"); if (principal == NULL) - return 0; + { + log_print ("check_policy: failed to allocate memory for principal"); + LC (RSA_free, (key)); + return 0; + } + princ2 = calloc(strlen(principal) + strlen("rsa-hex:") + 1, sizeof(char)); + if (princ2 == NULL) + { + log_print ("check_policy: failed to allocate memory for principal"); + free(principal); + LC (RSA_free, (key)); + return 0; + } + + strcpy(princ2, "rsa-hex:"); + strcpy(princ2 + strlen("rsa-hex:"), principal); + free(principal); LC (RSA_free, (key)); + principal = princ2; + princ2 = NULL; break; /* XXX Eventually handle these. */ |