if (!BN_add(y, z, BN_value_one())) ABORT;
if (BN_is_odd(y)) ABORT;
if (!BN_rshift1(y, y)) ABORT;
- scalars[0] = y; /* (group order + 1)/2, so y*Q + y*Q = Q */
+ scalars[0] = y; /* (group order + 1)/2, so y*Q + y*Q = Q */
scalars[1] = y;
fprintf(stdout, "combined multiplication ...");
*
* @param _x expression to test (should evaluate to true)
*/
-#define fr_cond_assert(_x) (bool)((_x) ? true : (fr_cond_assert_fail(__FILE__, __LINE__, #_x) && false))
+#define fr_cond_assert(_x) (bool)((_x) ? true : (fr_cond_assert_fail(__FILE__, __LINE__, #_x) && false))
void NEVER_RETURNS _fr_exit(char const *file, int line, int status);
-# define fr_exit(_x) _fr_exit(__FILE__, __LINE__, (_x))
+# define fr_exit(_x) _fr_exit(__FILE__, __LINE__, (_x))
void NEVER_RETURNS _fr_exit_now(char const *file, int line, int status);
-# define fr_exit_now(_x) _fr_exit_now(__FILE__, __LINE__, (_x))
+# define fr_exit_now(_x) _fr_exit_now(__FILE__, __LINE__, (_x))
#endif /* _FR_DEBUG_H */
#endif
#ifdef WITH_VERIFY_PTR
-# define VERIFY_DA(_x) fr_dict_verify(__FILE__, __LINE__, _x)
+# define VERIFY_DA(_x) fr_dict_verify(__FILE__, __LINE__, _x)
#else
# define VERIFY_DA(_x) fr_cond_assert(_x)
#endif
#define ACCT(fmt, ...) _FR_LOG(L_ACCT, fmt, ## __VA_ARGS__)
#define PROXY(fmt, ...) _FR_LOG(L_PROXY, fmt, ## __VA_ARGS__)
-#define INFO(fmt, ...) _FR_LOG(L_INFO, fmt, ## __VA_ARGS__)
+#define INFO(fmt, ...) _FR_LOG(L_INFO, fmt, ## __VA_ARGS__)
#define WARN(fmt, ...) _FR_LOG(L_WARN, fmt, ## __VA_ARGS__)
#define ERROR(fmt, ...) _FR_LOG(L_ERR, fmt, ## __VA_ARGS__)
#define PERROR(fmt, ...) _FR_LOG_PERROR(L_ERR, fmt, ## __VA_ARGS__)
#endif
#ifdef WITH_VERIFY_PTR
-# define VERIFY_VP(_x) fr_pair_verify(__FILE__, __LINE__, _x)
-# define VERIFY_LIST(_x) fr_pair_list_verify(__FILE__, __LINE__, NULL, _x)
+# define VERIFY_VP(_x) fr_pair_verify(__FILE__, __LINE__, _x)
+# define VERIFY_LIST(_x) fr_pair_list_verify(__FILE__, __LINE__, NULL, _x)
# define VERIFY_PACKET(_x) (void) talloc_get_type_abort(_x, RADIUS_PACKET)
#else
/*
#ifndef NDEBUG
# define FR_PROTO_TRACE(_x, ...) if (fr_log_fp && (fr_debug_lvl > 3)) fr_proto_print(__FILE__, __LINE__, _x, ## __VA_ARGS__)
# define FR_PROTO_HEX_DUMP(_x, _y, _z) if (fr_log_fp && (fr_debug_lvl > 3)) fr_proto_print_hex_data(__FILE__, __LINE__, _x, _y, _z)
-# define FR_PROTO_STACK_PRINT(_x, _y) if (fr_log_fp && (fr_debug_lvl > 3)) fr_proto_tlv_stack_print( __FILE__, __LINE__, __FUNCTION__, _x, _y)
+# define FR_PROTO_STACK_PRINT(_x, _y) if (fr_log_fp && (fr_debug_lvl > 3)) fr_proto_tlv_stack_print( __FILE__, __LINE__, __FUNCTION__, _x, _y)
#else
# define FR_PROTO_TRACE(_x, ...)
# define FR_PROTO_HEX_DUMP(_x, _y, _z)
/** Use for conditions that should result in an assert in dev builds, and return in non-dev builds
*
*/
-#define rad_cond_assert(_x) (bool)((_x) ? true : (fr_assert_fail(__FILE__, __LINE__, #_x) && false))
+#define rad_cond_assert(_x) (bool)((_x) ? true : (fr_assert_fail(__FILE__, __LINE__, #_x) && false))
#ifdef __cplusplus
}
#ifndef WITH_VERIFY_PTR
# define VERIFY_TMPL(_x)
#else
-# define VERIFY_TMPL(_x) tmpl_verify(__FILE__, __LINE__, _x)
+# define VERIFY_TMPL(_x) tmpl_verify(__FILE__, __LINE__, _x)
void tmpl_verify(char const *file, int line, vp_tmpl_t const *vpt);
#endif
}
#endif
- len = snprintf(p, outlen - (p - out), "%%%u", addr->scope_id);
+ len = snprintf(p, outlen - (p - out), "%%%u", addr->scope_id);
if (is_truncated(len + (p - out), outlen)) {
fr_strerror_printf("Address buffer too small, needed %zu bytes, have %zu bytes",
(p - out) + len, outlen);
{ "+=", T_OP_ADD, },
{ "-=", T_OP_SUB, },
{ ":=", T_OP_SET, },
- { "=*", T_OP_CMP_TRUE, },
+ { "=*", T_OP_CMP_TRUE, },
{ "!*", T_OP_CMP_FALSE, },
{ "==", T_OP_CMP_EQ, },
{ "=", T_OP_EQ, },
in.sin_port = htons(port);
fl = tl = sizeof(struct sockaddr_in);
memset(&from, 0, sizeof(from));
- memset(&to, 0, sizeof(to));
+ memset(&to, 0, sizeof(to));
switch (pid = fork()) {
case -1:
return snprintf(out, outlen, "%zu", data->datum.size);
case FR_TYPE_TIMEVAL:
- len = snprintf(buf, sizeof(buf), "%" PRIu64 ".%06" PRIu64,
+ len = snprintf(buf, sizeof(buf), "%" PRIu64 ".%06" PRIu64,
(uint64_t)data->datum.timeval.tv_sec, (uint64_t)data->datum.timeval.tv_usec);
a = buf;
break;
/* not static so were thread safe */
rs_stats_value_tmpl_t const _packet_count[] = {
- { &stats->interval.received, LCC_TYPE_GAUGE, _copy_double_to_double, NULL },
- { &stats->interval.linked, LCC_TYPE_GAUGE, _copy_double_to_double, NULL },
- { &stats->interval.unlinked, LCC_TYPE_GAUGE, _copy_double_to_double, NULL },
- { &stats->interval.reused, LCC_TYPE_GAUGE, _copy_double_to_double, NULL },
+ { &stats->interval.received, LCC_TYPE_GAUGE, _copy_double_to_double, NULL },
+ { &stats->interval.linked, LCC_TYPE_GAUGE, _copy_double_to_double, NULL },
+ { &stats->interval.unlinked, LCC_TYPE_GAUGE, _copy_double_to_double, NULL },
+ { &stats->interval.reused, LCC_TYPE_GAUGE, _copy_double_to_double, NULL },
{ NULL, 0, NULL, NULL }
};
{ FR_CONF_OFFSET("gid", FR_TYPE_STRING, fr_command_socket_t, gid_name) },
{ FR_CONF_OFFSET("mode", FR_TYPE_STRING, fr_command_socket_t, mode_name) },
{ FR_CONF_OFFSET("peercred", FR_TYPE_BOOL, fr_command_socket_t, peercred), .dflt = "yes" },
- { FR_CONF_OFFSET("blocking", FR_TYPE_BOOL, fr_command_socket_t, blocking), },
+ { FR_CONF_OFFSET("blocking", FR_TYPE_BOOL, fr_command_socket_t, blocking), },
CONF_PARSER_TERMINATOR
};
"terminate - terminates the server, and cause it to exit",
command_terminate, NULL },
{ "set", FR_WRITE, NULL, NULL, command_table_set },
- { "show", FR_READ, NULL, NULL, command_table_show },
+ { "show", FR_READ, NULL, NULL, command_table_show },
#ifdef WITH_STATS
- { "stats", FR_READ, NULL, NULL, command_table_stats },
+ { "stats", FR_READ, NULL, NULL, command_table_stats },
#endif
{ NULL, 0, NULL, NULL, NULL }
}
-static ssize_t cond_tokenize_string(TALLOC_CTX *ctx, char **out, char const **error, char const *start, FR_TOKEN *op)
+static ssize_t cond_tokenize_string(TALLOC_CTX *ctx, char **out, char const **error, char const *start, FR_TOKEN *op)
{
char const *p = start;
char *q;
value = fr_pair_asprint(request, vp, '"');
- RDEBUGX(level, "%s%s", prefix ? prefix : "&", value);
+ RDEBUGX(level, "%s%s", prefix ? prefix : "&", value);
talloc_free(value);
}
VERIFY_VP(vp);
value = fr_pair_asprint(request, vp, '"');
- RDEBUGX(level, "%s%s", prefix ? prefix : "&", value);
+ RDEBUGX(level, "%s%s", prefix ? prefix : "&", value);
talloc_free(value);
}
REXDENT();
if (vp->da->flags.internal) continue;
value = fr_pair_asprint(request, vp, '"');
- RDEBUGX(level, "%s%s", prefix ? prefix : "", value);
+ RDEBUGX(level, "%s%s", prefix ? prefix : "", value);
talloc_free(value);
}
REXDENT();
}
#endif
- rbtree_walk(packet_list, RBTREE_DELETE_ORDER, request_delete_cb, NULL);
+ rbtree_walk(packet_list, RBTREE_DELETE_ORDER, request_delete_cb, NULL);
if (spawn_workers) {
/*
}
if (have_rt || stats->interval.lost || stats->interval.reused) {
- INFO("%s retransmits & loss:", fr_packet_codes[code]);
+ INFO("%s retransmits & loss:", fr_packet_codes[code]);
if (stats->interval.lost) INFO("\tLost : %.3lf/s", stats->interval.lost);
if (stats->interval.reused) INFO("\tID Reused : %.3lf/s", stats->interval.reused);
}
}
- cf_log_info(cs, "\tauthhost = %s", host);
+ cf_log_info(cs, "\tauthhost = %s", host);
if (!old_server_add(rc, cs, r->name, host, secret, ldflag,
&r->auth_pool, HOME_TYPE_AUTH, NULL)) {
* This is parented separately.
*
* The reason why it's OK to do this, is if the state attributes
- * need to persist across requests, they will already have been
+ * need to persist across requests, they will already have been
* moved to a fr_state_entry_t, with the state pointers in the
* request being set to NULL, before the request is freed.
*/
break;
}
} else {
- REDEBUG("Sending client %s TLS alert: %s %i", SSL_alert_type_string_long(ret),
+ REDEBUG("Sending client %s TLS alert: %s %i", SSL_alert_type_string_long(ret),
SSL_alert_desc_string_long(ret), ret & 0xff);
}
return;
attr = cf_pair_attr(cp);
DEBUG2(" %s%.*s : %s", attr,
- (int)(max - talloc_array_length(attr)), spaces, cf_pair_value(cp));
+ (int)(max - talloc_array_length(attr)), spaces, cf_pair_value(cp));
}
talloc_free(features);
attr = cf_pair_attr(cp);
DEBUG2(" %s%.*s : %s", attr,
- (int)(max - talloc_array_length(attr)), spaces, cf_pair_value(cp));
+ (int)(max - talloc_array_length(attr)), spaces, cf_pair_value(cp));
}
#ifdef WITH_TLS
if (!localtime_r(&when, &ts)) goto error;
nl = str + strftime(str, freespace, "%Y-%m-%d-%H.%M.%S", &ts);
rad_assert(((str + freespace) - nl) >= 8);
- snprintf(nl, (str + freespace) - nl, ".%06d", (int) microseconds);
+ snprintf(nl, (str + freespace) - nl, ".%06d", (int) microseconds);
break;
case 'Y': /* request year */
*(p++) = '\0';
} else {
- slen = xlat_tokenize_literal(node, p, &node->alternate, true, error);
+ slen = xlat_tokenize_literal(node, p, &node->alternate, true, error);
if (slen <= 0) {
talloc_free(node);
return slen - (p - fmt);
*/
filter = talloc_strdup(this, "(udp and dst port ");
if (sock->lsock.my_port) {
- filter = talloc_asprintf_append_buffer(filter, "%u)", sock->lsock.my_port);
+ filter = talloc_asprintf_append_buffer(filter, "%u)", sock->lsock.my_port);
} else {
filter = talloc_strdup_append_buffer(filter, "bootps)");
}
* - 0 on success.
* - -1 on failure.
*/
-static int _proto_ldap_entry(fr_ldap_conn_t *conn, sync_config_t const *config,
+static int _proto_ldap_entry(fr_ldap_conn_t *conn, sync_config_t const *config,
int sync_id, UNUSED sync_phases_t phase,
uint8_t const uuid[SYNC_UUID_LENGTH], LDAPMessage *msg,
sync_states_t state, void *user_ctx)
RDEBUG2("Retrieved %zu bytes from memcached", len);
RDEBUG2("%s", from_store);
- c = talloc_zero(NULL, rlm_cache_entry_t);
+ c = talloc_zero(NULL, rlm_cache_entry_t);
ret = cache_deserialize(c, from_store, len);
free(from_store);
if (ret < 0) {
* are three chunks per map
*/
- c = talloc_pooled_object(NULL, rlm_cache_entry_t, reply->elements, pool_size);
+ c = talloc_pooled_object(NULL, rlm_cache_entry_t, reply->elements, pool_size);
memset(&pool, 0, sizeof(rlm_cache_entry_t));
#else
c = talloc_zero(NULL, rlm_cache_entry_t);
* @copydetails cache_entry_expire_t
*/
static cache_status_t cache_entry_expire(UNUSED rlm_cache_config_t const *config, void *instance,
- REQUEST *request, UNUSED void *handle, uint8_t const *key, size_t key_len)
+ REQUEST *request, UNUSED void *handle, uint8_t const *key, size_t key_len)
{
rlm_cache_redis_t *driver = instance;
fr_redis_cluster_state_t state;
* Pass the raw data to the callback, which will
* create the VP and add it to the map.
*/
- if (map_to_request(request, map, _map_proc_client_get_vp, &uctx) < 0) {
+ if (map_to_request(request, map, _map_proc_client_get_vp, &uctx) < 0) {
rcode = RLM_MODULE_FAIL;
talloc_free(field);
break;
#ifdef WITH_SESSION_MGMT
{ FR_CONF_OFFSET("check_simul", FR_TYPE_BOOL, rlm_couchbase_t, check_simul) }, /* NULL defaults to "no" */
{ FR_CONF_OFFSET("simul_view", FR_TYPE_STRING, rlm_couchbase_t, simul_view), .dflt = "_design/acct/_view/by_user" },
- { FR_CONF_OFFSET("simul_vkey", FR_TYPE_TMPL, rlm_couchbase_t, simul_vkey), .dflt = "%{tolower:%{%{Stripped-User-Name}:-%{User-Name}}}", .quote = T_DOUBLE_QUOTED_STRING },
+ { FR_CONF_OFFSET("simul_vkey", FR_TYPE_TMPL, rlm_couchbase_t, simul_vkey), .dflt = "%{tolower:%{%{Stripped-User-Name}:-%{User-Name}}}", .quote = T_DOUBLE_QUOTED_STRING },
{ FR_CONF_OFFSET("verify_simul", FR_TYPE_BOOL, rlm_couchbase_t, verify_simul) }, /* NULL defaults to "no" */
#endif
CONF_PARSER_TERMINATOR
size_t SSL_get_server_random(const SSL *ssl, unsigned char *out, size_t outlen);
#endif
-void T_PRF(unsigned char const *secret, unsigned int secret_len, char const *prf_label, unsigned char const *seed, unsigned int seed_len, unsigned char *out, unsigned int out_len) CC_HINT(nonnull(1,3,6));
+void T_PRF(unsigned char const *secret, unsigned int secret_len, char const *prf_label, unsigned char const *seed, unsigned int seed_len, unsigned char *out, unsigned int out_len) CC_HINT(nonnull(1,3,6));
void eap_tls_gen_mppe_keys(REQUEST *request, SSL *s, char const *prf_label) CC_HINT(nonnull);
*/
static void P_hash(EVP_MD const *evp_md,
unsigned char const *secret, unsigned int secret_len,
- unsigned char const *seed, unsigned int seed_len,
+ unsigned char const *seed, unsigned int seed_len,
unsigned char *out, unsigned int out_len)
{
HMAC_CTX *ctx_a, *ctx_out;
/* EAP-FAST Pseudo-Random Function (T-PRF): RFC 4851, Section 5.5 */
void T_PRF(unsigned char const *secret, unsigned int secret_len,
char const *prf_label,
- unsigned char const *seed, unsigned int seed_len,
+ unsigned char const *seed, unsigned int seed_len,
unsigned char *out, unsigned int out_len)
{
size_t prf_size = strlen(prf_label);
}
static void PRF(unsigned char const *secret, unsigned int secret_len,
- unsigned char const *seed, unsigned int seed_len,
+ unsigned char const *seed, unsigned int seed_len,
unsigned char *out, unsigned char *buf, unsigned int out_len)
{
unsigned int i;
uint8_t const *s1 = secret;
uint8_t const *s2 = secret + (secret_len - len);
- P_hash(EVP_md5(), s1, len, seed, seed_len, out, out_len);
+ P_hash(EVP_md5(), s1, len, seed, seed_len, out, out_len);
P_hash(EVP_sha1(), s2, len, seed, seed_len, buf, out_len);
for (i=0; i < out_len; i++) {
memcpy(&xkey, mk, sizeof(xkey));
/* make the value 1 */
- memset(&one, 0, sizeof(one));
+ memset(&one, 0, sizeof(one));
one.p[19]=1;
f = out;
fr_sha1_final_no_len(w_0.p, &context);
/* c. XKEY = (1 + XKEY + w_0) mod 2^160 */
- onesixty_add_mod(&sum, &xkey, &w_0);
- onesixty_add_mod(&xkey, &sum, &one);
+ onesixty_add_mod(&sum, &xkey, &w_0);
+ onesixty_add_mod(&xkey, &sum, &one);
/* d. XVAL = XKEY */
xval = xkey;
fr_sha1_final_no_len(w_1.p, &context);
/* f. XKEY = (1 + XKEY + w_1) mod 2^160 */
- onesixty_add_mod(&sum, &xkey, &w_1);
- onesixty_add_mod(&xkey, &sum, &one);
+ onesixty_add_mod(&sum, &xkey, &w_1);
+ onesixty_add_mod(&xkey, &sum, &one);
/* now store it away */
memcpy(f, &w_0, 20);
bool req_client_cert; //!< Whether we require the client to provide
//!< a certificate or not. RFC 5216 says it's
- //!< not mandatory, and there are some situations
+ //!< not mandatory, and there are some situations
//!< where it's useful to allow client access without
//!< a certificate.
* This function does it's own xlat of the input program
* to execute.
*/
- result = radius_exec_program(request, *out, outlen, NULL, request, fmt, input_pairs ? *input_pairs : NULL,
+ result = radius_exec_program(request, *out, outlen, NULL, request, fmt, input_pairs ? *input_pairs : NULL,
inst->wait, inst->shell_escape, inst->timeout);
if (result != 0) return -1;
redisReply *reply = NULL;
char const *log_prefix = node->cluster->log_prefix;
- DEBUG2("%s [%i]: Connecting node to %s:%i", log_prefix, node->id, node->name, node->addr.port);
+ DEBUG2("%s [%i]: Connecting node to %s:%i", log_prefix, node->id, node->name, node->addr.port);
handle = redisConnectWithTimeout(node->name, node->addr.port, *timeout);
if ((handle != NULL) && handle->err) {
* connections implement retry delays.
*/
fr_redis_rcode_t fr_redis_cluster_state_init(fr_redis_cluster_state_t *state, fr_redis_conn_t **conn,
- fr_redis_cluster_t *cluster, REQUEST *request,
+ fr_redis_cluster_t *cluster, REQUEST *request,
uint8_t const *key, size_t key_len, bool read_only);
fr_redis_rcode_t fr_redis_cluster_state_next(fr_redis_cluster_state_t *state, fr_redis_conn_t **conn,
* - 0 if status was updated successfully.
* - -1 if status was not updated successfully.
*/
-static int rlm_rest_status_update(REQUEST *request, void *handle)
+static int rlm_rest_status_update(REQUEST *request, void *handle)
{
TALLOC_CTX *ctx;
VALUE_PAIR **list;
*/
row = SQLConnect(conn->dbc_handle,
server, SQL_NTS,
- login, SQL_NTS,
+ login, SQL_NTS,
password, SQL_NTS);
}
* - #RLM_SQL_RECONNECT if a new handle is required (also sets *handle = NULL).
* - #RLM_SQL_QUERY_INVALID, #RLM_SQL_ERROR on invalid query or connection error.
*/
-sql_rcode_t rlm_sql_select_query(rlm_sql_t const *inst, REQUEST *request, rlm_sql_handle_t **handle, char const *query)
+sql_rcode_t rlm_sql_select_query(rlm_sql_t const *inst, REQUEST *request, rlm_sql_handle_t **handle, char const *query)
{
int ret = RLM_SQL_ERROR;
int i, count;
struct in_addr ip = {0}; /* reserved IP for client (net. byte order) */
rlm_sql_handle_t *sqlsock;
unsigned long s_gid, /* _s_elected in sql result set */
- s_prio, /* as above */
+ s_prio, /* as above */
s_pid, /* as above */
gid, /* real integer value */
pid, /* as above */
return 0;
}
-rlm_rcode_t rlm_yubikey_validate(rlm_yubikey_t const *inst, REQUEST *request, char const *passcode)
+rlm_rcode_t rlm_yubikey_validate(rlm_yubikey_t const *inst, REQUEST *request, char const *passcode)
{
rlm_rcode_t rcode = RLM_MODULE_OK;
ykclient_rc status;
uint8_t const *data, size_t data_len,
void *decoder_ctx);
-ssize_t fr_radius_decode_pair(TALLOC_CTX *ctx, vp_cursor_t *cursor, fr_dict_attr_t const *parent,
+ssize_t fr_radius_decode_pair(TALLOC_CTX *ctx, vp_cursor_t *cursor, fr_dict_attr_t const *parent,
uint8_t const *data, size_t data_len,
void *decoder_ctx);