diff options
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-add.c,v 1.105 2012/12/05 15:42:52 markus Exp $ */ | 1 | /* $OpenBSD: ssh-add.c,v 1.106 2013/05/17 00:13:14 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -90,7 +90,7 @@ clear_pass(void) | |||
90 | { | 90 | { |
91 | if (pass) { | 91 | if (pass) { |
92 | memset(pass, 0, strlen(pass)); | 92 | memset(pass, 0, strlen(pass)); |
93 | xfree(pass); | 93 | free(pass); |
94 | pass = NULL; | 94 | pass = NULL; |
95 | } | 95 | } |
96 | } | 96 | } |
@@ -215,7 +215,7 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only) | |||
215 | pass = read_passphrase(msg, RP_ALLOW_STDIN); | 215 | pass = read_passphrase(msg, RP_ALLOW_STDIN); |
216 | if (strcmp(pass, "") == 0) { | 216 | if (strcmp(pass, "") == 0) { |
217 | clear_pass(); | 217 | clear_pass(); |
218 | xfree(comment); | 218 | free(comment); |
219 | buffer_free(&keyblob); | 219 | buffer_free(&keyblob); |
220 | return -1; | 220 | return -1; |
221 | } | 221 | } |
@@ -246,9 +246,9 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only) | |||
246 | if (blacklisted_key(private, &fp) == 1) { | 246 | if (blacklisted_key(private, &fp) == 1) { |
247 | fprintf(stderr, "Public key %s blacklisted (see " | 247 | fprintf(stderr, "Public key %s blacklisted (see " |
248 | "ssh-vulnkey(1)); refusing to add it\n", fp); | 248 | "ssh-vulnkey(1)); refusing to add it\n", fp); |
249 | xfree(fp); | 249 | free(fp); |
250 | key_free(private); | 250 | key_free(private); |
251 | xfree(comment); | 251 | free(comment); |
252 | return -1; | 252 | return -1; |
253 | } | 253 | } |
254 | 254 | ||
@@ -290,8 +290,8 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only) | |||
290 | fprintf(stderr, "The user must confirm each use of the key\n"); | 290 | fprintf(stderr, "The user must confirm each use of the key\n"); |
291 | out: | 291 | out: |
292 | if (certpath != NULL) | 292 | if (certpath != NULL) |
293 | xfree(certpath); | 293 | free(certpath); |
294 | xfree(comment); | 294 | free(comment); |
295 | key_free(private); | 295 | key_free(private); |
296 | 296 | ||
297 | return ret; | 297 | return ret; |
@@ -316,7 +316,7 @@ update_card(AuthenticationConnection *ac, int add, const char *id) | |||
316 | add ? "add" : "remove", id); | 316 | add ? "add" : "remove", id); |
317 | ret = -1; | 317 | ret = -1; |
318 | } | 318 | } |
319 | xfree(pin); | 319 | free(pin); |
320 | return ret; | 320 | return ret; |
321 | } | 321 | } |
322 | 322 | ||
@@ -338,14 +338,14 @@ list_identities(AuthenticationConnection *ac, int do_fp) | |||
338 | SSH_FP_HEX); | 338 | SSH_FP_HEX); |
339 | printf("%d %s %s (%s)\n", | 339 | printf("%d %s %s (%s)\n", |
340 | key_size(key), fp, comment, key_type(key)); | 340 | key_size(key), fp, comment, key_type(key)); |
341 | xfree(fp); | 341 | free(fp); |
342 | } else { | 342 | } else { |
343 | if (!key_write(key, stdout)) | 343 | if (!key_write(key, stdout)) |
344 | fprintf(stderr, "key_write failed"); | 344 | fprintf(stderr, "key_write failed"); |
345 | fprintf(stdout, " %s\n", comment); | 345 | fprintf(stdout, " %s\n", comment); |
346 | } | 346 | } |
347 | key_free(key); | 347 | key_free(key); |
348 | xfree(comment); | 348 | free(comment); |
349 | } | 349 | } |
350 | } | 350 | } |
351 | if (!had_identities) { | 351 | if (!had_identities) { |
@@ -371,7 +371,7 @@ lock_agent(AuthenticationConnection *ac, int lock) | |||
371 | passok = 0; | 371 | passok = 0; |
372 | } | 372 | } |
373 | memset(p2, 0, strlen(p2)); | 373 | memset(p2, 0, strlen(p2)); |
374 | xfree(p2); | 374 | free(p2); |
375 | } | 375 | } |
376 | if (passok && ssh_lock_agent(ac, lock, p1)) { | 376 | if (passok && ssh_lock_agent(ac, lock, p1)) { |
377 | fprintf(stderr, "Agent %slocked.\n", lock ? "" : "un"); | 377 | fprintf(stderr, "Agent %slocked.\n", lock ? "" : "un"); |
@@ -379,7 +379,7 @@ lock_agent(AuthenticationConnection *ac, int lock) | |||
379 | } else | 379 | } else |
380 | fprintf(stderr, "Failed to %slock agent.\n", lock ? "" : "un"); | 380 | fprintf(stderr, "Failed to %slock agent.\n", lock ? "" : "un"); |
381 | memset(p1, 0, strlen(p1)); | 381 | memset(p1, 0, strlen(p1)); |
382 | xfree(p1); | 382 | free(p1); |
383 | return (ret); | 383 | return (ret); |
384 | } | 384 | } |
385 | 385 | ||