summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sshsig.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sshsig.c b/sshsig.c
index e63a36e1e..77df4db86 100644
--- a/sshsig.c
+++ b/sshsig.c
@@ -209,8 +209,10 @@ sshsig_wrap_sign(struct sshkey *key, const char *hashalg,
209 goto done; 209 goto done;
210 } 210 }
211 211
212 *out = blob; 212 if (out != NULL) {
213 blob = NULL; 213 *out = blob;
214 blob = NULL;
215 }
214 r = 0; 216 r = 0;
215done: 217done:
216 free(sig); 218 free(sig);
@@ -424,7 +426,7 @@ hash_buffer(const struct sshbuf *m, const char *hashalg, struct sshbuf **bp)
424 out: 426 out:
425 sshbuf_free(b); 427 sshbuf_free(b);
426 explicit_bzero(hash, sizeof(hash)); 428 explicit_bzero(hash, sizeof(hash));
427 return 0; 429 return r;
428} 430}
429 431
430int 432int
@@ -552,7 +554,7 @@ hash_file(int fd, const char *hashalg, struct sshbuf **bp)
552 sshbuf_free(b); 554 sshbuf_free(b);
553 ssh_digest_free(ctx); 555 ssh_digest_free(ctx);
554 explicit_bzero(hash, sizeof(hash)); 556 explicit_bzero(hash, sizeof(hash));
555 return 0; 557 return r;
556} 558}
557 559
558int 560int
@@ -835,7 +837,7 @@ sshsig_check_allowed_keys(const char *path, const struct sshkey *sign_key,
835 char *line = NULL; 837 char *line = NULL;
836 size_t linesize = 0; 838 size_t linesize = 0;
837 u_long linenum = 0; 839 u_long linenum = 0;
838 int r, oerrno; 840 int r = SSH_ERR_INTERNAL_ERROR, oerrno;
839 841
840 /* Check key and principal against file */ 842 /* Check key and principal against file */
841 if ((f = fopen(path, "r")) == NULL) { 843 if ((f = fopen(path, "r")) == NULL) {