projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Major and incompatible overhaul of key_data representation. Fix leaks.
[u/mdw/catacomb]
/
catcrypt.c
diff --git
a/catcrypt.c
b/catcrypt.c
index
967730a
..
4c343a4
100644
(file)
--- a/
catcrypt.c
+++ b/
catcrypt.c
@@
-313,6
+313,7
@@
static int encrypt(int argc, char *argv[])
freeenc(e);
if (s) freesig(s);
freekem(km);
freeenc(e);
if (s) freesig(s);
freekem(km);
+ if (fp != stdin) fclose(fp);
if (of) fclose(ofp);
key_close(&kf);
dstr_destroy(&d);
if (of) fclose(ofp);
key_close(&kf);
dstr_destroy(&d);
@@
-459,6
+460,7
@@
static int decrypt(int argc, char *argv[])
key_fulltag(sk, &d);
printf("INFO good-signature %s\n", d.buf);
}
key_fulltag(sk, &d);
printf("INFO good-signature %s\n", d.buf);
}
+ freesig(s);
} else if (verb)
printf("INFO no-signature\n");
} else if (verb)
printf("INFO no-signature\n");
@@
-499,6
+501,7
@@
static int decrypt(int argc, char *argv[])
printf("FAIL bad ciphertext chunk: authentication failure\n");
exit(EXIT_FAILURE);
}
printf("FAIL bad ciphertext chunk: authentication failure\n");
exit(EXIT_FAILURE);
}
+ GH_DESTROY(h);
if (!BLEFT(&b))
break;
GC_DECRYPT(c, BCUR(&b), BCUR(&b), BLEFT(&b));
if (!BLEFT(&b))
break;
GC_DECRYPT(c, BCUR(&b), BCUR(&b), BLEFT(&b));
@@
-541,6
+544,7
@@
static int decrypt(int argc, char *argv[])
GC_DESTROY(cx);
GM_DESTROY(m);
freekem(km);
GC_DESTROY(cx);
GM_DESTROY(m);
freekem(km);
+ if (fp != stdin) fclose(fp);
if (of) fclose(ofp);
key_close(&kf);
dstr_destroy(&d);
if (of) fclose(ofp);
key_close(&kf);
dstr_destroy(&d);