Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion modules/ssl/ssl_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,15 @@ ssl_asn1_t *ssl_asn1_table_set(apr_hash_t *table, const char *key,
{
apr_ssize_t klen = strlen(key);
ssl_asn1_t *asn1 = apr_hash_get(table, key, klen);
apr_size_t length = i2d_PrivateKey(pkey, NULL);
int derlen = i2d_PrivateKey(pkey, NULL);
apr_size_t length;
unsigned char *p;

/* Encoding the key length can only fail in pathological cases which
* cannot occur for a key which has already been loaded and used. */
ap_assert(derlen > 0);
length = (apr_size_t)derlen;

/* Re-use structure if cached previously. */
if (asn1) {
if (asn1->nData != length) {
Expand Down