Skip to content

Commit 08a96e4

Browse files
committed
uams: guard SRP logincont against missing session state
Check that the SRP session verifier is set before proceeding in srp_logincont, preventing a NULL pointer dereference if the login step was skipped or failed.
1 parent 25cdf98 commit 08a96e4

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

etc/uams/uams_srp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,14 @@ static int srp_logincont(void *obj _U_, struct passwd **uam_pwd,
643643
unsigned char A_buf[SRP_NBYTES];
644644
unsigned char K[SRP_SESSION_KEY_LEN];
645645
*rbuflen = 0;
646+
647+
/* Make sure srp_setup actually ran and established session state */
648+
if (session_v == NULL) {
649+
LOG(log_error, logtype_uams, "srp_logincont: called without completing setup");
650+
ret = AFPERR_PARAM;
651+
goto fail;
652+
}
653+
646654
unsigned char *d = (unsigned char *)ibuf;
647655
const unsigned char *end = d + ibuflen;
648656

0 commit comments

Comments
 (0)