X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=user_list.c;h=9cde1f625e3d9fd8dc2c198dd9775db2a5b24879;hp=a1f1557c6fefb21d0586d6fb85c990c795dbb51a;hb=c387b216b5fd3c944053e1bba024815719e9a0d9;hpb=9b565c60fd159e12d255bb18db9dbff066deebea diff --git a/user_list.c b/user_list.c index a1f1557c..9cde1f62 100644 --- a/user_list.c +++ b/user_list.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2010 Andre Noll + * Copyright (C) 2006-2011 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -9,7 +9,6 @@ #include #include #include -#include #include "para.h" #include "error.h" @@ -41,7 +40,7 @@ static void populate_user_list(char *user_list_file) /* keyword, name, key, perms */ char w[255], n[255], k[255], p[255], tmp[4][255]; struct user *u; - RSA *rsa; + struct asymmetric_key *pubkey; ret = para_fgets(line, sizeof(line), file_ptr); if (ret <= 0) @@ -51,7 +50,7 @@ static void populate_user_list(char *user_list_file) if (strcmp(w, "user")) continue; PARA_DEBUG_LOG("found entry for user %s\n", n); - ret = get_rsa_key(k, &rsa, LOAD_PUBLIC_KEY); + ret = get_asymmetric_key(k, LOAD_PUBLIC_KEY, &pubkey); if (ret < 0) { PARA_NOTICE_LOG("skipping entry for user %s: %s\n", n, para_strerror(-ret)); @@ -64,14 +63,14 @@ static void populate_user_list(char *user_list_file) * which are too short. For details see RSA_public_encrypt(3). */ if (ret <= CHALLENGE_SIZE + 2 * RC4_KEY_LEN + 41) { - PARA_WARNING_LOG("rsa key %s too short (%d)\n", + PARA_WARNING_LOG("public key %s too short (%d)\n", k, ret); - rsa_free(rsa); + free_asymmetric_key(pubkey); continue; } u = para_malloc(sizeof(*u)); u->name = para_strdup(n); - u->rsa = rsa; + u->pubkey = pubkey; u->perms = 0; num = sscanf(p, "%200[A-Z_],%200[A-Z_],%200[A-Z_],%200[A-Z_]", tmp[0], tmp[1], tmp[2], tmp[3]); @@ -117,7 +116,7 @@ void init_user_list(char *user_list_file) list_for_each_entry_safe(u, tmp, &user_list, node) { list_del(&u->node); free(u->name); - rsa_free(u->rsa); + free_asymmetric_key(u->pubkey); free(u); } } else