mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-08-08 09:21:48 +08:00
Merge branch 'tmp-uninitialised-handle' into 'master'
Do not use uninitialised PAM/GnuTLS handles Closes #722 See merge request openconnect/ocserv!547
This commit is contained in:
+1
-1
@@ -62,7 +62,7 @@ static int pam_acct_open_session(void *vctx, unsigned int auth_method,
|
||||
pret = pam_start(PACKAGE, ai->username, &dc, &ph);
|
||||
if (pret != PAM_SUCCESS) {
|
||||
oc_syslog(LOG_NOTICE, "PAM-acct init: %s",
|
||||
pam_strerror(ph, pret));
|
||||
pam_strerror(NULL, pret));
|
||||
goto fail1;
|
||||
}
|
||||
|
||||
|
||||
@@ -160,13 +160,6 @@ static int ca_handler(worker_st *ws, unsigned int http_ver, unsigned int der)
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = gnutls_x509_crt_init(&issuer);
|
||||
if (ret < 0) {
|
||||
oclog(ws, LOG_DEBUG, "could not initialize cert");
|
||||
ret = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = gnutls_x509_crt_import(crt, &certs[0],
|
||||
GNUTLS_X509_FMT_DER);
|
||||
if (ret < 0) {
|
||||
@@ -182,6 +175,14 @@ static int ca_handler(worker_st *ws, unsigned int http_ver, unsigned int der)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = gnutls_x509_crt_init(&issuer);
|
||||
if (ret < 0) {
|
||||
ret = -1;
|
||||
oclog(ws, LOG_DEBUG,
|
||||
"could not initialize issuer cert");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = gnutls_x509_crt_import(issuer, &tmpca,
|
||||
GNUTLS_X509_FMT_DER);
|
||||
if (ret < 0) {
|
||||
|
||||
Reference in New Issue
Block a user