X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=crypt.c;h=4762fddcf018b27ee365931c22151c2216a29e86;hp=7b7c16d348952dab0dccbbd2170af178a703adb3;hb=d16fe3df649cb48d5ffa26187da3dad4c3066646;hpb=c5670af5c1f784fe6c3d46d0281f2ba7c47af75e diff --git a/crypt.c b/crypt.c index 7b7c16d3..4762fddc 100644 --- a/crypt.c +++ b/crypt.c @@ -7,7 +7,6 @@ /** \file crypt.c Openssl-based encryption/decryption routines. */ #include -#include #include #include #include @@ -184,24 +183,25 @@ int get_asymmetric_key(const char *key_file, int private, PARA_INFO_LOG("decoding public rsa-ssh key %s\n", key_file); ret = -ERRNO_TO_PARA_ERROR(EOVERFLOW); if (map_size > INT_MAX / 4) - goto out; + goto out_unmap; blob_size = 2 * map_size; blob = para_malloc(blob_size); ret = uudecode(cp, blob, blob_size); if (ret < 0) - goto out; + goto out_unmap; decoded_size = ret; ret = check_ssh_key_header(blob, decoded_size); if (ret < 0) - goto out; + goto out_unmap; ret = read_rsa_bignums(blob + ret, decoded_size - ret, &key->rsa); if (ret < 0) - goto out; + goto out_unmap; ret = RSA_size(key->rsa); -out: +out_unmap: ret2 = para_munmap(map, map_size); if (ret >= 0 && ret2 < 0) ret = ret2; +out: if (ret < 0) { free(key); *result = NULL;