summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/crypto/krb/yarrow/ycipher.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/crypto/krb/yarrow/ycipher.c b/src/lib/crypto/krb/yarrow/ycipher.c
index 7222d94c5..8a664ac31 100644
--- a/src/lib/crypto/krb/yarrow/ycipher.c
+++ b/src/lib/crypto/krb/yarrow/ycipher.c
@@ -74,6 +74,12 @@ int krb5int_yarrow_cipher_encrypt_block(CIPHER_CTX *ctx,
krb5_crypto_iov iov;
const struct krb5_enc_provider *enc = &yarrow_enc_provider;
+ /*
+ This can happen if ENOMEM in initializing the key
+ which happens on init or during reseeding
+ */
+ if (!ctx->key)
+ return YARROW_FAIL;
memcpy(out, in, CIPHER_BLOCK_SIZE);
iov.flags = KRB5_CRYPTO_TYPE_DATA;
iov.data = make_data(out, CIPHER_BLOCK_SIZE);