- djm@cvs.openbsd.org 2013/12/19 00:27:57

[auth-options.c]
     simplify freeing of source-address certificate restriction
This commit is contained in:
Damien Miller 2013-12-29 17:44:56 +11:00
parent bb3dafe702
commit bf25d114e2
2 changed files with 10 additions and 7 deletions

View File

@ -11,6 +11,9 @@
Cast client_alive_interval to u_int64_t before assinging to Cast client_alive_interval to u_int64_t before assinging to
max_time_milliseconds to avoid potential integer overflow in the timeout. max_time_milliseconds to avoid potential integer overflow in the timeout.
bz#2170, patch from Loganaden Velvindron, ok djm@ bz#2170, patch from Loganaden Velvindron, ok djm@
- djm@cvs.openbsd.org 2013/12/19 00:27:57
[auth-options.c]
simplify freeing of source-address certificate restriction
20131221 20131221
- (dtucker) [regress/keytype.sh] Actually test ecdsa key types. - (dtucker) [regress/keytype.sh] Actually test ecdsa key types.

View File

@ -1,4 +1,4 @@
/* $OpenBSD: auth-options.c,v 1.61 2013/11/08 00:39:14 djm Exp $ */ /* $OpenBSD: auth-options.c,v 1.62 2013/12/19 00:27:57 djm Exp $ */
/* /*
* Author: Tatu Ylonen <ylo@cs.hut.fi> * Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -432,7 +432,7 @@ parse_option_list(u_char *optblob, size_t optblob_len, struct passwd *pw,
u_char *data_blob = NULL; u_char *data_blob = NULL;
u_int nlen, dlen, clen; u_int nlen, dlen, clen;
Buffer c, data; Buffer c, data;
int ret = -1, found; int ret = -1, result, found;
buffer_init(&data); buffer_init(&data);
@ -501,11 +501,12 @@ parse_option_list(u_char *optblob, size_t optblob_len, struct passwd *pw,
goto out; goto out;
} }
remote_ip = get_remote_ipaddr(); remote_ip = get_remote_ipaddr();
switch (addr_match_cidr_list(remote_ip, result = addr_match_cidr_list(remote_ip,
allowed)) { allowed);
free(allowed);
switch (result) {
case 1: case 1:
/* accepted */ /* accepted */
free(allowed);
break; break;
case 0: case 0:
/* no match */ /* no match */
@ -518,12 +519,11 @@ parse_option_list(u_char *optblob, size_t optblob_len, struct passwd *pw,
"is not permitted to use this " "is not permitted to use this "
"certificate for login.", "certificate for login.",
remote_ip); remote_ip);
free(allowed);
goto out; goto out;
case -1: case -1:
default:
error("Certificate source-address " error("Certificate source-address "
"contents invalid"); "contents invalid");
free(allowed);
goto out; goto out;
} }
found = 1; found = 1;