Skip to content

Commit e5c8584

Browse files
Dr. David Alan Gilbertchucklever
authored andcommitted
SUNRPC: Remove unused krb5_decrypt
The last use of krb5_decrypt() was removed in 2023 by commit 2a9893f ("SUNRPC: Remove net/sunrpc/auth_gss/gss_krb5_seqnum.c") Remove it. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 9a28ac1 commit e5c8584

File tree

2 files changed

+0
-57
lines changed

2 files changed

+0
-57
lines changed

net/sunrpc/auth_gss/gss_krb5_crypto.c

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -138,60 +138,6 @@ krb5_encrypt(
138138
return ret;
139139
}
140140

141-
/**
142-
* krb5_decrypt - simple decryption of an RPCSEC GSS payload
143-
* @tfm: initialized cipher transform
144-
* @iv: pointer to an IV
145-
* @in: ciphertext to decrypt
146-
* @out: OUT: plaintext
147-
* @length: length of input and output buffers, in bytes
148-
*
149-
* @iv may be NULL to force the use of an all-zero IV.
150-
* The buffer containing the IV must be as large as the
151-
* cipher's ivsize.
152-
*
153-
* Return values:
154-
* %0: @in successfully decrypted into @out
155-
* negative errno: @in not decrypted
156-
*/
157-
u32
158-
krb5_decrypt(
159-
struct crypto_sync_skcipher *tfm,
160-
void * iv,
161-
void * in,
162-
void * out,
163-
int length)
164-
{
165-
u32 ret = -EINVAL;
166-
struct scatterlist sg[1];
167-
u8 local_iv[GSS_KRB5_MAX_BLOCKSIZE] = {0};
168-
SYNC_SKCIPHER_REQUEST_ON_STACK(req, tfm);
169-
170-
if (length % crypto_sync_skcipher_blocksize(tfm) != 0)
171-
goto out;
172-
173-
if (crypto_sync_skcipher_ivsize(tfm) > GSS_KRB5_MAX_BLOCKSIZE) {
174-
dprintk("RPC: gss_k5decrypt: tfm iv size too large %d\n",
175-
crypto_sync_skcipher_ivsize(tfm));
176-
goto out;
177-
}
178-
if (iv)
179-
memcpy(local_iv, iv, crypto_sync_skcipher_ivsize(tfm));
180-
181-
memcpy(out, in, length);
182-
sg_init_one(sg, out, length);
183-
184-
skcipher_request_set_sync_tfm(req, tfm);
185-
skcipher_request_set_callback(req, 0, NULL, NULL);
186-
skcipher_request_set_crypt(req, sg, sg, length, local_iv);
187-
188-
ret = crypto_skcipher_decrypt(req);
189-
skcipher_request_zero(req);
190-
out:
191-
dprintk("RPC: gss_k5decrypt returns %d\n",ret);
192-
return ret;
193-
}
194-
195141
static int
196142
checksummer(struct scatterlist *sg, void *data)
197143
{

net/sunrpc/auth_gss/gss_krb5_internal.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,6 @@ u32 gss_krb5_checksum(struct crypto_ahash *tfm, char *header, int hdrlen,
166166
u32 krb5_encrypt(struct crypto_sync_skcipher *key, void *iv, void *in,
167167
void *out, int length);
168168

169-
u32 krb5_decrypt(struct crypto_sync_skcipher *key, void *iv, void *in,
170-
void *out, int length);
171-
172169
int xdr_extend_head(struct xdr_buf *buf, unsigned int base,
173170
unsigned int shiftlen);
174171

0 commit comments

Comments
 (0)