NeoMutt  2025-09-05-55-g97fc89
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
auth_gss.c File Reference

IMAP GSS authentication method. More...

#include "config.h"
#include <arpa/inet.h>
#include <string.h>
#include "private.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "conn/lib.h"
#include "adata.h"
#include "auth.h"
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_generic.h>
+ Include dependency graph for auth_gss.c:

Go to the source code of this file.

Macros

#define GSS_AUTH_P_NONE   1
 
#define GSS_AUTH_P_INTEGRITY   2
 
#define GSS_AUTH_P_PRIVACY   4
 

Functions

static void print_gss_error (OM_uint32 err_maj, OM_uint32 err_min)
 Print detailed error message to the debug log.
 
enum ImapAuthRes imap_auth_gss (struct ImapAccountData *adata, const char *method)
 GSS Authentication support - Implements ImapAuth::authenticate() -.
 

Detailed Description

IMAP GSS authentication method.

Authors
  • Brendan Cully
  • Richard Russon
  • Ian Zimmerman

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file auth_gss.c.

Macro Definition Documentation

◆ GSS_AUTH_P_NONE

#define GSS_AUTH_P_NONE   1

Definition at line 56 of file auth_gss.c.

◆ GSS_AUTH_P_INTEGRITY

#define GSS_AUTH_P_INTEGRITY   2

Definition at line 57 of file auth_gss.c.

◆ GSS_AUTH_P_PRIVACY

#define GSS_AUTH_P_PRIVACY   4

Definition at line 58 of file auth_gss.c.

Function Documentation

◆ print_gss_error()

static void print_gss_error ( OM_uint32 err_maj,
OM_uint32 err_min )
static

Print detailed error message to the debug log.

Parameters
err_majError's major number
err_minError's minor number

Definition at line 65 of file auth_gss.c.

66{
67 OM_uint32 maj_stat, min_stat;
68 OM_uint32 msg_ctx = 0;
69 gss_buffer_desc status_string;
70 char buf_maj[512] = { 0 };
71 char buf_min[512] = { 0 };
72
73 do
74 {
75 maj_stat = gss_display_status(&min_stat, err_maj, GSS_C_GSS_CODE,
76 GSS_C_NO_OID, &msg_ctx, &status_string);
77 if (GSS_ERROR(maj_stat))
78 break;
79 size_t status_len = status_string.length;
80 if (status_len >= sizeof(buf_maj))
81 status_len = sizeof(buf_maj) - 1;
82 strncpy(buf_maj, (char *) status_string.value, status_len);
83 buf_maj[status_len] = '\0';
84 gss_release_buffer(&min_stat, &status_string);
85
86 maj_stat = gss_display_status(&min_stat, err_min, GSS_C_MECH_CODE,
87 GSS_C_NULL_OID, &msg_ctx, &status_string);
88 if (!GSS_ERROR(maj_stat))
89 {
90 status_len = status_string.length;
91 if (status_len >= sizeof(buf_min))
92 status_len = sizeof(buf_min) - 1;
93 strncpy(buf_min, (char *) status_string.value, status_len);
94 buf_min[status_len] = '\0';
95 gss_release_buffer(&min_stat, &status_string);
96 }
97 } while (!GSS_ERROR(maj_stat) && (msg_ctx != 0));
98
99 mutt_debug(LL_DEBUG2, "((%s:%d )(%s:%d))\n", buf_maj, err_maj, buf_min, err_min);
100}
#define mutt_debug(LEVEL,...)
Definition logging2.h:90
@ LL_DEBUG2
Log at debug level 2.
Definition logging2.h:45
+ Here is the caller graph for this function: