projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 't/clang_analyzer_fixes'
[paraslash.git]
/
crypt.c
diff --git
a/crypt.c
b/crypt.c
index
7b7c16d
..
431de6f
100644
(file)
--- a/
crypt.c
+++ b/
crypt.c
@@
-184,24
+184,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)
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)
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)
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)
ret = read_rsa_bignums(blob + ret, decoded_size - ret, &key->rsa);
if (ret < 0)
- goto out;
+ goto out
_unmap
;
ret = RSA_size(key->rsa);
ret = RSA_size(key->rsa);
-out:
+out
_unmap
:
ret2 = para_munmap(map, map_size);
if (ret >= 0 && ret2 < 0)
ret = ret2;
ret2 = para_munmap(map, map_size);
if (ret >= 0 && ret2 < 0)
ret = ret2;
+out:
if (ret < 0) {
free(key);
*result = NULL;
if (ret < 0) {
free(key);
*result = NULL;