#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
#include <sys/types.h>
#include <pthread.h>
#include "otp.h"
Go to the source code of this file.
|
void | _otp_pthread_mutex_init (pthread_mutex_t *, pthread_mutexattr_t const *, char const *) |
| Guaranteed initialization. More...
|
|
void | _otp_pthread_mutex_lock (pthread_mutex_t *, char const *) |
| Guaranteed lock. More...
|
|
int | _otp_pthread_mutex_trylock (pthread_mutex_t *, char const *) |
| Guaranteed trylock. More...
|
|
void | _otp_pthread_mutex_unlock (pthread_mutex_t *, char const *) |
| Guaranteed unlock. More...
|
|
ssize_t | otp_a2x (uint8_t const *, size_t, uint8_t *) |
|
void | otp_async_challenge (char[OTP_MAX_CHALLENGE_LEN+1], size_t) |
| Generate a random challenge (ascii chars 0-9) More...
|
|
size_t | otp_gen_state (char[OTP_MAX_RADSTATE_LEN], char const [OTP_MAX_CHALLENGE_LEN], size_t, int32_t, int32_t, uint8_t const [16]) |
| Generate an OTP state value. More...
|
|
void | otp_get_random (uint8_t *, size_t) |
| Generate some random bytes. More...
|
|
void | otp_mppe (REQUEST *, otp_pwe_t, rlm_otp_t const *, char const *) |
|
int | otp_pw_valid (REQUEST *, int, char const *, rlm_otp_t const *, char[]) |
|
void | otp_pwe_init (void) |
|
otp_pwe_t | otp_pwe_present (REQUEST const *) |
|
Definition at line 41 of file extern.h.
Data Fields |
bool |
allow_async |
C/R mode allowed? |
bool |
allow_sync |
Useful to override pwdfile card_type settings. |
char const * |
chal_prompt |
Text to present challenge to user must have s. |
uint32_t |
challenge_delay |
Max delay time for response, in seconds. |
uint32_t |
challenge_len |
Challenge length, min 5 digits. |
uint8_t |
hmac_key[16] |
because it doesn't track State |
uint32_t |
mschap_mppe_policy |
Whether or not do to mppe for mschap . |
uint32_t |
mschap_mppe_types |
key type/length for mschap/mppe. |
uint32_t |
mschapv2_mppe_policy |
Whether or not do to mppe for mschapv2. |
uint32_t |
mschapv2_mppe_types |
Key type/length for mschapv2/mppe. |
char const * |
name |
Instance name for mod_authorize(). |
char const * |
otpd_rp |
Otpd rendezvous point. |
#define OTP_CHALLENGE_PROMPT "Challenge: %{reply:OTP-Challenge}\n Response: " |
#define OTP_OTPD_RP "/var/run/otpd/socket" |
void _otp_pthread_mutex_init |
( |
pthread_mutex_t * |
mutexp, |
|
|
pthread_mutexattr_t const * |
attr, |
|
|
char const * |
caller |
|
) |
| |
Guaranteed initialization.
Definition at line 82 of file otp_util.c.
void _otp_pthread_mutex_lock |
( |
pthread_mutex_t * |
mutexp, |
|
|
char const * |
caller |
|
) |
| |
int _otp_pthread_mutex_trylock |
( |
pthread_mutex_t * |
mutexp, |
|
|
char const * |
caller |
|
) |
| |
void _otp_pthread_mutex_unlock |
( |
pthread_mutex_t * |
mutexp, |
|
|
char const * |
caller |
|
) |
| |
ssize_t otp_a2x |
( |
uint8_t const * |
, |
|
|
size_t |
, |
|
|
uint8_t * |
|
|
) |
| |
void otp_async_challenge |
( |
char |
challenge[OTP_MAX_CHALLENGE_LEN+1], |
|
|
size_t |
len |
|
) |
| |
Generate a random challenge (ascii chars 0-9)
- Note
- This is really cryptocard-specific (automatic ASCII conversion
-
and null termination).
- Parameters
-
[out] | challenge | Buffer to write random string to. |
[in] | len | Number of random bytes to write to buffer. |
Definition at line 63 of file otp_util.c.
size_t otp_gen_state |
( |
char |
state[OTP_MAX_RADSTATE_LEN], |
|
|
char const |
challenge[OTP_MAX_CHALLENGE_LEN], |
|
|
size_t |
clen, |
|
|
int32_t |
flags, |
|
|
int32_t |
when, |
|
|
uint8_t const |
key[16] |
|
) |
| |
Generate an OTP state value.
Generates an OTP state value (an string of ASCII hexits in an opaque binary string).
- Parameters
-
[out] | state | buffer in which to write the generated state value. |
[in] | challenge | The challenge value. |
[in] | clen | The length of the challenge data. |
[in] | flags | to remember. |
[in] | when | the challenge was originally generated. |
[in] | key | HMAC key. |
- Returns
- the amount of data written into the state buffer.
Definition at line 108 of file otp_radstate.c.
void otp_get_random |
( |
uint8_t * |
rnd_data, |
|
|
size_t |
len |
|
) |
| |
Generate some random bytes.
- Parameters
-
rnd_data | Buffer to write bytes to. |
len | Number of bytes to write. |
Definition at line 37 of file otp_util.c.
int otp_pw_valid |
( |
REQUEST * |
, |
|
|
int |
, |
|
|
char const * |
, |
|
|
rlm_otp_t const * |
, |
|
|
char |
[] |
|
) |
| |
void otp_pwe_init |
( |
void |
| ) |
|