Skip to content

Commit

Permalink
Allow zero-length identity response
Browse files Browse the repository at this point in the history
ok tobhe
  • Loading branch information
yasuoka committed Mar 24, 2024
1 parent a96d88d commit 142156d
Show file tree
Hide file tree
Showing 2 changed files with 759 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sbin/iked/eap.c
@@ -1,4 +1,4 @@
/* $OpenBSD: eap.c,v 1.25 2023/07/18 15:07:41 claudio Exp $ */
/* $OpenBSD: eap.c,v 1.26 2024/03/24 00:05:01 yasuoka Exp $ */

/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
Expand Down Expand Up @@ -71,7 +71,12 @@ eap_validate_id_response(struct eap_message *eap)
len = betoh16(eap->eap_length) - sizeof(*eap);
ptr += sizeof(*eap);

if (len == 0 || (str = get_string(ptr, len)) == NULL) {
if (len == 0) {
if ((str = strdup("")) == NULL) {
log_warn("%s: strdup failed", __func__);
return (NULL);
}
} else if ((str = get_string(ptr, len)) == NULL) {
log_info("%s: invalid identity response, length %zu",
__func__, len);
return (NULL);
Expand Down

0 comments on commit 142156d

Please sign in to comment.