NeoMutt  2024-10-02-37-gfa9146
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 <stdio.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 57 of file auth_gss.c.

◆ GSS_AUTH_P_INTEGRITY

#define GSS_AUTH_P_INTEGRITY   2

Definition at line 58 of file auth_gss.c.

◆ GSS_AUTH_P_PRIVACY

#define GSS_AUTH_P_PRIVACY   4

Definition at line 59 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 66 of file auth_gss.c.

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