Commit ae551760 authored by Ben Laurie's avatar Ben Laurie
Browse files

Fix some warnings caused by __owur. Temporarily (I hope) remove the more

aspirational __owur annotations.
parent fe068648
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -170,6 +170,7 @@ my %table=(
"debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
"debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
"debug-ben-debug",	"gcc:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -g3 -O2 -pipe::(unknown)::::::",
"debug-ben-macos",	"cc:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch i386 -O3 -DL_ENDIAN -g3 -pipe::(unknown)::::::",
"debug-ben-no-opt",	"gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::",
"debug-ben-strict",	"gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::",
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
+7 −3
Original line number Diff line number Diff line
@@ -549,9 +549,13 @@ bad:
				sptr = salt;
			}

			EVP_BytesToKey(cipher,dgst,sptr,
			if (!EVP_BytesToKey(cipher,dgst,sptr,
					    (unsigned char *)str,
				strlen(str),1,key,iv);
					    strlen(str),1,key,iv))
				{
				BIO_printf(bio_err, "EVP_BytesToKey failed\n");
				goto end;
				}
			/* zero the complete buffer or the string
			 * passed from the command line
			 * bug picked up by
+2 −1
Original line number Diff line number Diff line
@@ -618,7 +618,8 @@ static int create_digest(BIO *input, char *digest, const EVP_MD *md,
			{
			EVP_DigestUpdate(&md_ctx, buffer, length);
			}
		EVP_DigestFinal(&md_ctx, *md_value, NULL);
		if (!EVP_DigestFinal(&md_ctx, *md_value, NULL))
			return 0;
		}
	else
		{
+11 −9
Original line number Diff line number Diff line
@@ -239,21 +239,22 @@ static int kek_unwrap_key(unsigned char *out, size_t *outlen,
		}
	tmp = OPENSSL_malloc(inlen);
	/* setup IV by decrypting last two blocks */
	EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl,
				in  + inlen - 2 * blocklen, blocklen * 2);
	if (!EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl,
			       in  + inlen - 2 * blocklen, blocklen * 2)
	/* Do a decrypt of last decrypted block to set IV to correct value
	 * output it to start of buffer so we don't corrupt decrypted block
	 * this works because buffer is at least two block lengths long.
	 */
	EVP_DecryptUpdate(ctx, tmp, &outl,
				tmp  + inlen - blocklen, blocklen);
	    || !EVP_DecryptUpdate(ctx, tmp, &outl,
				  tmp  + inlen - blocklen, blocklen)
	/* Can now decrypt first n - 1 blocks */
	EVP_DecryptUpdate(ctx, tmp, &outl, in, inlen - blocklen);
	    || !EVP_DecryptUpdate(ctx, tmp, &outl, in, inlen - blocklen)

	/* Reset IV to original value */
	EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL);
	    || !EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL)
	/* Decrypt again */
	EVP_DecryptUpdate(ctx, tmp, &outl, tmp, inlen);
	    || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp, inlen))
		goto err;
	/* Check check bytes */
	if (((tmp[1] ^ tmp[4]) & (tmp[2] ^ tmp[5]) & (tmp[3] ^ tmp[6])) != 0xff)
		{
@@ -308,8 +309,9 @@ static int kek_wrap_key(unsigned char *out, size_t *outlen,
		if (olen > inlen + 4)
			RAND_pseudo_bytes(out + 4 + inlen, olen - 4 - inlen);
		/* Encrypt twice */
		EVP_EncryptUpdate(ctx, out, &dummy, out, olen);
		EVP_EncryptUpdate(ctx, out, &dummy, out, olen);
		if (!EVP_EncryptUpdate(ctx, out, &dummy, out, olen)
		    || !EVP_EncryptUpdate(ctx, out, &dummy, out, olen))
			return 0;
		}

	*outlen = olen;
+4 −3
Original line number Diff line number Diff line
@@ -196,9 +196,10 @@ int x9_62_test_internal(BIO *out, int nid, const char *r_in, const char *s_in)

	EVP_MD_CTX_init(&md_ctx);
	/* get the message digest */
	EVP_DigestInit(&md_ctx, EVP_ecdsa());
	EVP_DigestUpdate(&md_ctx, (const void*)message, 3);
	EVP_DigestFinal(&md_ctx, digest, &dgst_len);
	if (!EVP_DigestInit(&md_ctx, EVP_ecdsa())
	    || !EVP_DigestUpdate(&md_ctx, (const void*)message, 3)
	    || !EVP_DigestFinal(&md_ctx, digest, &dgst_len))
		goto x962_int_err;

	BIO_printf(out, "testing %s: ", OBJ_nid2sn(nid));
	/* create the key */
Loading