Add a poisoned field to EVP_CIPHER_CTX.
Poison the EVP_CIPHER_CTX structure on failures, and indicate
that it is an error to re-use an EVP_CIPHER_CTX context in another
call after a failure.
Bug: 494
Change-Id: Ibcdf28b83a2e690f7aab789d908c076d844231c6
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/54185
Commit-Queue: Bob Beck <bbe@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h
index 380d25d..ba4b698 100644
--- a/include/openssl/cipher.h
+++ b/include/openssl/cipher.h
@@ -587,6 +587,9 @@
int final_used;
uint8_t final[EVP_MAX_BLOCK_LENGTH]; // possible final block
+
+ // Has this structure been rendered unusable by a failure.
+ int poisoned;
} /* EVP_CIPHER_CTX */;
typedef struct evp_cipher_info_st {