X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=user_list.c;h=f2436c9e5bf7a835db2553c4c54db112d628b40d;hb=501b83a39828c9d3db5498c7352a2e5b60175bba;hp=030865fad614a3a9b2b190da0e3cf1d9ceb94a25;hpb=0e5dedaa7f494adcd2970c301343fc04933fae72;p=paraslash.git diff --git a/user_list.c b/user_list.c index 030865fa..f2436c9e 100644 --- a/user_list.c +++ b/user_list.c @@ -13,7 +13,7 @@ #include "list.h" #include "user_list.h" -INITIALIZED_LIST_HEAD(user_list); +static INITIALIZED_LIST_HEAD(user_list); /* * Wrapper for fgets(3). @@ -52,7 +52,7 @@ void user_list_deplete(void) list_for_each_entry_safe(u, tmpu, &user_list, node) { list_del(&u->node); free(u->name); - free_public_key(u->pubkey); + apc_free_pubkey(u->pubkey); free(u); } } @@ -92,25 +92,25 @@ void user_list_init(const char *user_list_file) if (strcmp(w, "user")) continue; PARA_DEBUG_LOG("found entry for user %s\n", n); - ret = get_public_key(k, &pubkey); + ret = apc_get_pubkey(k, &pubkey); if (ret < 0) { PARA_NOTICE_LOG("skipping entry for user %s: %s\n", n, para_strerror(-ret)); continue; } /* - * In order to encrypt len := CHALLENGE_SIZE + 2 * SESSION_KEY_LEN + * In order to encrypt len := APC_CHALLENGE_SIZE + 2 * SESSION_KEY_LEN * bytes using RSA_public_encrypt() with EME-OAEP padding mode, * RSA_size(rsa) must be greater than len + 41. So ignore keys * which are too short. For details see RSA_public_encrypt(3). */ - if (ret <= CHALLENGE_SIZE + 2 * SESSION_KEY_LEN + 41) { + if (ret <= APC_CHALLENGE_SIZE + 2 * SESSION_KEY_LEN + 41) { PARA_WARNING_LOG("public key %s too short (%d)\n", k, ret); - free_public_key(pubkey); + apc_free_pubkey(pubkey); continue; } - u = para_malloc(sizeof(*u)); + u = alloc(sizeof(*u)); u->name = para_strdup(n); u->pubkey = pubkey; u->perms = 0;