diff options
author | Steve Langasek <steve.langasek@canonical.com> | 2020-08-11 14:54:29 -0700 |
---|---|---|
committer | Steve Langasek <steve.langasek@canonical.com> | 2020-08-11 14:54:29 -0700 |
commit | f6d08ed47a3da3c08345bce2ca366e961c52ad7c (patch) | |
tree | dcbd0efb229b17f696f7195671f05b354b4f70fc /libpamc/include/security/pam_client.h | |
parent | 668b13da8f830c38388cecac45539972e80cb246 (diff) | |
parent | 9e5bea9e146dee574796259ca464ad2435be3590 (diff) | |
download | pam-f6d08ed47a3da3c08345bce2ca366e961c52ad7c.tar.gz pam-f6d08ed47a3da3c08345bce2ca366e961c52ad7c.tar.bz2 pam-f6d08ed47a3da3c08345bce2ca366e961c52ad7c.zip |
New upstream version 1.4.0
Diffstat (limited to 'libpamc/include/security/pam_client.h')
-rw-r--r-- | libpamc/include/security/pam_client.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/libpamc/include/security/pam_client.h b/libpamc/include/security/pam_client.h index 47e41aaf..41f83da6 100644 --- a/libpamc/include/security/pam_client.h +++ b/libpamc/include/security/pam_client.h @@ -16,6 +16,7 @@ extern "C" { #include <unistd.h> #include <string.h> #include <stdio.h> +#include <stdint.h> #include <sys/types.h> /* opaque agent handling structure */ @@ -23,7 +24,7 @@ extern "C" { typedef struct pamc_handle_s *pamc_handle_t; /* binary prompt structure pointer */ -typedef struct { u_int32_t length; u_int8_t control; } *pamc_bp_t; +typedef struct { uint32_t length; uint8_t control; } *pamc_bp_t; /* * functions provided by libpamc @@ -90,10 +91,10 @@ char **pamc_list_agents(pamc_handle_t pch); # define PAM_BP_FREE free #endif /* PAM_BP_FREE */ -#define __PAM_BP_WOCTET(x,y) (*((y) + (u_int8_t *)(x))) -#define __PAM_BP_ROCTET(x,y) (*((y) + (const u_int8_t *)(x))) +#define __PAM_BP_WOCTET(x,y) (*((y) + (uint8_t *)(x))) +#define __PAM_BP_ROCTET(x,y) (*((y) + (const uint8_t *)(x))) -#define PAM_BP_MIN_SIZE (sizeof(u_int32_t) + sizeof(u_int8_t)) +#define PAM_BP_MIN_SIZE (sizeof(uint32_t) + sizeof(uint8_t)) #define PAM_BP_MAX_LENGTH 0x20000 /* an advisory limit */ #define PAM_BP_WCONTROL(x) (__PAM_BP_WOCTET(x,4)) #define PAM_BP_RCONTROL(x) (__PAM_BP_ROCTET(x,4)) @@ -102,22 +103,22 @@ char **pamc_list_agents(pamc_handle_t pch); (__PAM_BP_ROCTET(x,2)<< 8)+ \ (__PAM_BP_ROCTET(x,3) )) #define PAM_BP_LENGTH(x) (PAM_BP_SIZE(x) - PAM_BP_MIN_SIZE) -#define PAM_BP_WDATA(x) (PAM_BP_MIN_SIZE + (u_int8_t *) (x)) -#define PAM_BP_RDATA(x) (PAM_BP_MIN_SIZE + (const u_int8_t *) (x)) +#define PAM_BP_WDATA(x) (PAM_BP_MIN_SIZE + (uint8_t *) (x)) +#define PAM_BP_RDATA(x) (PAM_BP_MIN_SIZE + (const uint8_t *) (x)) /* Note, this macro always '\0' terminates renewed packets */ #define PAM_BP_RENEW(old_p, cntrl, data_length) \ do { \ - if (old_p) { \ + if ((old_p) != NULL) { \ if (*(old_p)) { \ - u_int32_t __size; \ + uint32_t __size; \ __size = PAM_BP_SIZE(*(old_p)); \ memset(*(old_p), 0, __size); \ PAM_BP_FREE(*(old_p)); \ } \ if (cntrl) { \ - u_int32_t __size; \ + uint32_t __size; \ \ __size = PAM_BP_MIN_SIZE + data_length; \ if ((*(old_p) = PAM_BP_CALLOC(1, 1+__size))) { \ @@ -140,7 +141,7 @@ do { \ #define PAM_BP_FILL(prmpt, offset, length, data) \ do { \ size_t bp_length; \ - u_int8_t *prompt = (u_int8_t *) (prmpt); \ + uint8_t *prompt = (uint8_t *) (prmpt); \ bp_length = PAM_BP_LENGTH(prompt); \ if (bp_length < ((length)+(offset))) { \ PAM_BP_ASSERT("attempt to write over end of prompt"); \ @@ -151,7 +152,7 @@ do { \ #define PAM_BP_EXTRACT(prmpt, offset, length, data) \ do { \ size_t __bp_length; \ - const u_int8_t *__prompt = (const u_int8_t *) (prmpt); \ + const uint8_t *__prompt = (const uint8_t *) (prmpt); \ __bp_length = PAM_BP_LENGTH(__prompt); \ if (((offset) < 0) || (__bp_length < ((length)+(offset))) \ || ((length) < 0)) { \ |