Skip to content
Snippets Groups Projects
Commit 2df43686 authored by Chris Dunlap's avatar Chris Dunlap
Browse files

Removed MUNGE_OPT_CIPHER_TYPE, MUNGE_OPT_MAC_TYPE, & MUNGE_OPT_ZIP_TYPE queries.

Added MUNGE_OPT_ADDR4 query.
parent 6a4203c3
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <munge.h>
......@@ -95,11 +96,9 @@ typedef struct _slurm_auth_credential {
* Munge info structure for print* function
*/
typedef struct munge_info {
struct in_addr addr;
time_t encoded;
time_t decoded;
munge_cipher_t cipher;
munge_mac_t mac;
munge_zip_t zip;
} munge_info_t;
......@@ -509,6 +508,11 @@ cred_info_create(munge_ctx_t ctx)
munge_err_t e;
munge_info_t *mi = cred_info_alloc();
e = munge_ctx_get(ctx, MUNGE_OPT_ADDR4, &mi->addr);
if (e != EMUNGE_SUCCESS)
error ("auth_munge: Unable to retrieve origin addr: %s",
munge_ctx_strerror(ctx));
e = munge_ctx_get(ctx, MUNGE_OPT_ENCODE_TIME, &mi->encoded);
if (e != EMUNGE_SUCCESS)
error ("auth_munge: Unable to retrieve encode time: %s",
......@@ -519,21 +523,6 @@ cred_info_create(munge_ctx_t ctx)
error ("auth_munge: Unable to retrieve decode time: %s",
munge_ctx_strerror(ctx));
e = munge_ctx_get(ctx, MUNGE_OPT_CIPHER_TYPE, &mi->cipher);
if (e != EMUNGE_SUCCESS)
error ("auth_munge: Unable to retrieve cipher type: %s",
munge_ctx_strerror(ctx));
e = munge_ctx_get(ctx, MUNGE_OPT_MAC_TYPE, &mi->mac);
if (e != EMUNGE_SUCCESS)
error ("auth_munge: Unable to retrieve mac type: %s",
munge_ctx_strerror(ctx));
e = munge_ctx_get(ctx, MUNGE_OPT_ZIP_TYPE, &mi->zip);
if (e != EMUNGE_SUCCESS)
error ("auth_munge: Unable to retrieve zip type: %s",
munge_ctx_strerror(ctx));
return mi;
}
......@@ -545,27 +534,18 @@ static void
_print_cred_info(munge_info_t *mi)
{
char buf[256];
char addrbuf[INET_ADDRSTRLEN];
xassert(mi != NULL);
if (mi->encoded > 0) {
if (inet_ntop(AF_INET, &mi->addr, addrbuf, sizeof(addrbuf)))
info ("ORIGIN: %s", addrbuf);
if (mi->encoded > 0)
info ("ENCODED: %s", ctime_r(&mi->encoded, buf));
}
if (mi->decoded > 0) {
if (mi->decoded > 0)
info ("DECODED: %s", ctime_r(&mi->decoded, buf));
}
if (munge_enum_is_valid(MUNGE_ENUM_CIPHER, mi->cipher)) {
info ("CIPHER: %s",
munge_enum_int_to_str(MUNGE_ENUM_CIPHER, mi->cipher));
}
if (munge_enum_is_valid(MUNGE_ENUM_MAC, mi->mac)) {
info ("MAC: %s",
munge_enum_int_to_str(MUNGE_ENUM_MAC, mi->mac));
}
if (munge_enum_is_valid(MUNGE_ENUM_ZIP, mi->zip)) {
info ("ZIP: %s",
munge_enum_int_to_str(MUNGE_ENUM_ZIP, mi->zip));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment