[openssh-commits] [openssh] 01/02: upstream: remove cipher_set_keyiv() as nothing uses it from

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Jun 23 14:32:08 AEST 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 0d08d384a6783d3f3bc5a01d10015f527e0792ba
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Fri Jun 19 05:26:04 2026 +0000

    upstream: remove cipher_set_keyiv() as nothing uses it from
    
    Loganaden Velvindron
    
    OpenBSD-Commit-ID: 2a6636388028e6f7aa6837d6484a369f3d9c0818
---
 cipher.c | 32 +-------------------------------
 cipher.h |  3 +--
 2 files changed, 2 insertions(+), 33 deletions(-)

diff --git a/cipher.c b/cipher.c
index f3e8fd553..0697e559b 100644
--- a/cipher.c
+++ b/cipher.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cipher.c,v 1.128 2026/05/31 04:37:56 djm Exp $ */
+/* $OpenBSD: cipher.c,v 1.129 2026/06/19 05:26:04 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -471,33 +471,3 @@ cipher_get_keyiv(struct sshcipher_ctx *cc, u_char *iv, size_t len)
 #endif
 	return 0;
 }
-
-int
-cipher_set_keyiv(struct sshcipher_ctx *cc, const u_char *iv, size_t len)
-{
-#ifdef WITH_OPENSSL
-	const struct sshcipher *c = cc->cipher;
-	int evplen = 0;
-#endif
-
-	if ((cc->cipher->flags & CFLAG_CHACHAPOLY) != 0)
-		return 0;
-	if ((cc->cipher->flags & CFLAG_NONE) != 0)
-		return 0;
-
-#ifdef WITH_OPENSSL
-	evplen = EVP_CIPHER_CTX_iv_length(cc->evp);
-	if (evplen <= 0)
-		return SSH_ERR_LIBCRYPTO_ERROR;
-	if ((size_t)evplen != len)
-		return SSH_ERR_INVALID_ARGUMENT;
-	if (cipher_authlen(c)) {
-		/* XXX iv arg is const, but EVP_CIPHER_CTX_ctrl isn't */
-		if (EVP_CIPHER_CTX_ctrl(cc->evp,
-		    EVP_CTRL_GCM_SET_IV_FIXED, -1, (void *)iv) <= 0)
-			return SSH_ERR_LIBCRYPTO_ERROR;
-	} else if (!EVP_CIPHER_CTX_set_iv(cc->evp, iv, evplen))
-		return SSH_ERR_LIBCRYPTO_ERROR;
-#endif
-	return 0;
-}
diff --git a/cipher.h b/cipher.h
index 061a26b20..32abdde22 100644
--- a/cipher.h
+++ b/cipher.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cipher.h,v 1.57 2026/05/31 04:37:56 djm Exp $ */
+/* $OpenBSD: cipher.h,v 1.58 2026/06/19 05:26:04 djm Exp $ */
 
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
@@ -73,6 +73,5 @@ u_int	 cipher_is_internal(const struct sshcipher *);
 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);
 
 #endif				/* CIPHER_H */

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list