Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/include/libotpadm.h
Real path: /usr/include/libotpadm.h
Zurück
/* * Copyright (c) 2016, 2021, Oracle and/or its affiliates. */ #ifndef _LIBOTPADM_H #define _LIBOTPADM_H #ifdef __cplusplus extern "C" { #endif #include <fcntl.h> #include <libucrypto.h> #include <pwd.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> /* Less than 6 is not secure */ #define OTP_MIN_DIGITS 6 /* This is the most digits a uint32_t can have. */ #define OTP_MAX_DIGITS 10 #define OTP_HOTP_RESYNC_MAX 10 /* The TOTP auto drift adjustment becomes less effective at larger values */ #define OTP_TOTP_RESYNC_MAX 5 /* About the fastest a user can enter a code */ #define OTP_TOTP_STEP_MIN 6 /* About the longest a user can wait between logins (10 minutes) */ #define OTP_TOTP_STEP_MAX 600 /* Default values */ #define DEF_OTP_DIGITS 6 #define DEF_TOTP_T0 0 #define DEF_TOTP_STEP_SECS 30 #define DEF_TOTP_RESYNC_ATTEMPTS 2 #define DEF_HOTP_RESYNC_ATTEMPTS 2 typedef enum otp_mode { OTP_MODE_HOTP = 0, OTP_MODE_TOTP } otp_mode_t; typedef struct otp_config { /* Used to detect conflicting file modifications */ uint64_t oc_generation; /* Generic stuff */ boolean_t oc_have_auth; otp_mode_t oc_mode; ucrypto_mech_t oc_mech; uint32_t oc_digits; uint8_t *oc_secret; size_t oc_secret_len; /* Volatiles that can change as a result of auth (not otpadm) */ uint64_t oc_hotp_counter; int64_t oc_totp_drift; uint64_t oc_totp_used_step; } otp_config_t; enum otp_attr_enum { /* 0 is reserved */ OTP_MODE = 1, OTP_ALG = 2, OTP_DIGITS = 3, HOTP_COUNTER = 4, TOTP_DRIFT = 5, TOTP_LAST_TIME = 6, OTP_HAVE_AUTH = 7, OTP_SECRET_LEN = 8, OTP_SECRET = 9, OTP_SECRET_CHK = 10 }; typedef enum { OTP_CFG_COMPLETE = 0, OTP_CFG_NONE = 1, OTP_CFG_CORRUPT = 2, OTP_CFG_NOSECRET = 3, OTP_CFG_NOACCESS = 4, OTP_CFG_BADGENERATION = 5, OTP_CFG_MEMORY = 6 } otp_config_state_t; #define OTP_ATTR_COUNT 15 /* Attribute number is the offset in the array */ typedef struct { char *ae_string; boolean_t ae_readonly; } otp_attr_ent_t; extern otp_attr_ent_t otp_attr_tbl[]; extern int get_otp_attr_ent_bystring(const char *); extern void free_otp_config(otp_config_t *); extern void get_otp_default(otp_config_t *); extern otp_config_state_t read_otp_config(const char *, otp_config_t *); extern otp_config_state_t write_otp_config(const char *, otp_config_t *); extern void print_otp_attr(int, otp_config_t *, FILE *, boolean_t); extern boolean_t compute_otp(otp_config_t *, uchar_t *, size_t, uint32_t *); extern int delete_otp_config(const char *); extern int delete_otp_secret(const char *); extern int new_random_otp_secret(otp_config_t *); #ifdef __cplusplus } #endif #endif /* _LIBOTPADM_H */