]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Garbage collect cipher_get_keyiv_len()
authortb@openbsd.org <tb@openbsd.org>
Tue, 10 Oct 2023 06:49:54 +0000 (06:49 +0000)
committerDamien Miller <djm@mindrot.org>
Wed, 11 Oct 2023 04:57:08 +0000 (15:57 +1100)
This is a compat20 leftover, unused since 2017.

ok djm

OpenBSD-Commit-ID: 91fa5497c9dc6883064624ac27813a567883fdce

cipher.c
cipher.h

index 02aea4089ff91a51ceb11c33e6a0ad907aff5fd1..90b139c89985e6dc32c3d586a62bd6f588df5f71 100644 (file)
--- a/cipher.c
+++ b/cipher.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cipher.c,v 1.119 2021/04/03 06:18:40 djm Exp $ */
+/* $OpenBSD: cipher.c,v 1.120 2023/10/10 06:49:54 tb Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -434,27 +434,6 @@ cipher_free(struct sshcipher_ctx *cc)
        freezero(cc, sizeof(*cc));
 }
 
-/*
- * Exports an IV from the sshcipher_ctx required to export the key
- * state back from the unprivileged child to the privileged parent
- * process.
- */
-int
-cipher_get_keyiv_len(const struct sshcipher_ctx *cc)
-{
-       const struct sshcipher *c = cc->cipher;
-
-       if ((c->flags & CFLAG_CHACHAPOLY) != 0)
-               return 0;
-       else if ((c->flags & CFLAG_AESCTR) != 0)
-               return sizeof(cc->ac_ctx.ctr);
-#ifdef WITH_OPENSSL
-       return EVP_CIPHER_CTX_iv_length(cc->evp);
-#else
-       return 0;
-#endif
-}
-
 int
 cipher_get_keyiv(struct sshcipher_ctx *cc, u_char *iv, size_t len)
 {
index 1a591cd7fd46deccad4a776582a3bff7b68435df..6533ff2bbdec8fa4d695b2e7266d323e87761574 100644 (file)
--- a/cipher.h
+++ b/cipher.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cipher.h,v 1.55 2020/01/23 10:24:29 dtucker Exp $ */
+/* $OpenBSD: cipher.h,v 1.56 2023/10/10 06:49:54 tb Exp $ */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -73,6 +73,5 @@ u_int  cipher_ctx_is_plaintext(struct sshcipher_ctx *);
 
 int     cipher_get_keyiv(struct sshcipher_ctx *, u_char *, size_t);
 int     cipher_set_keyiv(struct sshcipher_ctx *, const u_char *, size_t);
-int     cipher_get_keyiv_len(const struct sshcipher_ctx *);
 
 #endif                         /* CIPHER_H */