diff options
Diffstat (limited to 'cipher.c')
-rw-r--r-- | cipher.c | 24 |
1 files changed, 1 insertions, 23 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cipher.c,v 1.105 2017/05/01 00:03:18 djm Exp $ */ | 1 | /* $OpenBSD: cipher.c,v 1.106 2017/05/04 01:33:21 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 |
@@ -456,28 +456,6 @@ cipher_free(struct sshcipher_ctx *cc) | |||
456 | } | 456 | } |
457 | 457 | ||
458 | /* | 458 | /* |
459 | * Selects the cipher, and keys if by computing the MD5 checksum of the | ||
460 | * passphrase and using the resulting 16 bytes as the key. | ||
461 | */ | ||
462 | int | ||
463 | cipher_set_key_string(struct sshcipher_ctx **ccp, | ||
464 | const struct sshcipher *cipher, const char *passphrase, int do_encrypt) | ||
465 | { | ||
466 | u_char digest[16]; | ||
467 | int r = SSH_ERR_INTERNAL_ERROR; | ||
468 | |||
469 | if ((r = ssh_digest_memory(SSH_DIGEST_MD5, | ||
470 | passphrase, strlen(passphrase), | ||
471 | digest, sizeof(digest))) != 0) | ||
472 | goto out; | ||
473 | |||
474 | r = cipher_init(ccp, cipher, digest, 16, NULL, 0, do_encrypt); | ||
475 | out: | ||
476 | explicit_bzero(digest, sizeof(digest)); | ||
477 | return r; | ||
478 | } | ||
479 | |||
480 | /* | ||
481 | * Exports an IV from the sshcipher_ctx required to export the key | 459 | * Exports an IV from the sshcipher_ctx required to export the key |
482 | * state back from the unprivileged child to the privileged parent | 460 | * state back from the unprivileged child to the privileged parent |
483 | * process. | 461 | * process. |