Commit 355a6236 authored by Trevor's avatar Trevor Committed by Ben Laurie
Browse files

Cosmetic touchups.

parent 6d7fa9c2
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -350,15 +350,15 @@ CERT *ssl_cert_dup(CERT *cert)
		if (cert->pkeys[i].serverinfo != NULL)
			{
			/* Just copy everything. */
			ret->pkeys[i].serverinfo_length =
				cert->pkeys[i].serverinfo_length;
			ret->pkeys[i].serverinfo =
				OPENSSL_malloc(ret->pkeys[i].serverinfo_length);
				OPENSSL_malloc(cert->pkeys[i].serverinfo_length);
			if (ret->pkeys[i].serverinfo == NULL)
				{
				SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_MALLOC_FAILURE);
				return NULL;
				}
			ret->pkeys[i].serverinfo_length =
				cert->pkeys[i].serverinfo_length;
			memcpy(ret->pkeys[i].serverinfo,
			       cert->pkeys[i].serverinfo,
			       cert->pkeys[i].serverinfo_length);
@@ -488,6 +488,7 @@ void ssl_cert_clear_certs(CERT *c)
			{
			OPENSSL_free(cpk->serverinfo);
			cpk->serverinfo = NULL;
			cpk->serverinfo_length = 0;
			}
#endif
		/* Clear all flags apart from explicit sign */
+8 −6
Original line number Diff line number Diff line
@@ -1715,16 +1715,17 @@ int SSL_CTX_set_custom_cli_ext(SSL_CTX *ctx, unsigned short ext_type,
			       custom_cli_ext_first_cb_fn fn1, 
			       custom_cli_ext_second_cb_fn fn2, void* arg)
	{
	/* Check for duplicates */
	size_t i;
	custom_cli_ext_record* record;

	/* Check for duplicates */
	for (i=0; i < ctx->custom_cli_ext_records_count; i++)
		if (ext_type == ctx->custom_cli_ext_records[i].ext_type)
			return 0;

	ctx->custom_cli_ext_records = OPENSSL_realloc(ctx->custom_cli_ext_records,
														(ctx->custom_cli_ext_records_count+1) * sizeof(custom_cli_ext_record));
						      (ctx->custom_cli_ext_records_count + 1) * 
						      sizeof(custom_cli_ext_record));
	if (!ctx->custom_cli_ext_records) {
		ctx->custom_cli_ext_records_count = 0;
		return 0;
@@ -1742,16 +1743,17 @@ int SSL_CTX_set_custom_srv_ext(SSL_CTX *ctx, unsigned short ext_type,
			       custom_srv_ext_first_cb_fn fn1, 
			       custom_srv_ext_second_cb_fn fn2, void* arg)
	{
	/* Check for duplicates */
	size_t i;
	custom_srv_ext_record* record;

	/* Check for duplicates */	
	for (i=0; i < ctx->custom_srv_ext_records_count; i++)
		if (ext_type == ctx->custom_srv_ext_records[i].ext_type)
			return 0;

	ctx->custom_srv_ext_records = OPENSSL_realloc(ctx->custom_srv_ext_records,
														(ctx->custom_srv_ext_records_count+1) * sizeof(custom_srv_ext_record));
						      (ctx->custom_srv_ext_records_count + 1) * 
						      sizeof(custom_srv_ext_record));
	if (!ctx->custom_srv_ext_records) {
		ctx->custom_srv_ext_records_count = 0;
		return 0;
+5 −5
Original line number Diff line number Diff line
@@ -2325,19 +2325,19 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char
				record = &s->ctx->custom_srv_ext_records[i];
				if (type == record->ext_type)
					{
					/* Error on duplicate TLS Extensions */
					size_t j;

					/* Error on duplicate TLS Extensions */
					for (j = 0; j < s->s3->tlsext_custom_types_count; j++)
						{
						if (s->s3->tlsext_custom_types[j] == type)
						if (type == s->s3->tlsext_custom_types[j])
							{
							*al = TLS1_AD_DECODE_ERROR;
							return 0;
							}
						}

					/* Callback */
					/* NULL callback still notes the extension */ 
					if (record->fn1 && !record->fn1(s, type, data, size, al, record->arg))
						return 0;
						
+1 −1

File changed.

Contains only whitespace changes.