<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libcrypto/pem, branch libressl-v3.2.2</title>
<subtitle>A mirror of https://github.com/libressl/openbsd.git
</subtitle>
<id>https://git.lua4.win/openbsd/atom?h=libressl-v3.2.2</id>
<link rel='self' href='https://git.lua4.win/openbsd/atom?h=libressl-v3.2.2'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/'/>
<updated>2020-07-25T11:53:37+00:00</updated>
<entry>
<title>remove half a dozen "goto" statements and a label</title>
<updated>2020-07-25T11:53:37+00:00</updated>
<author>
<name>schwarze</name>
<email></email>
</author>
<published>2020-07-25T11:53:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=0030d031a0ace03c9c7be82b8c636ad0dfbda45d'/>
<id>urn:sha1:0030d031a0ace03c9c7be82b8c636ad0dfbda45d</id>
<content type='text'>
that change nothing whatsoever, except making the code harder to read;
OK tb@
</content>
</entry>
<entry>
<title>Fix a bug in PEM_X509_INFO_read_bio(3) that is very likely to cause</title>
<updated>2020-07-23T17:15:35+00:00</updated>
<author>
<name>schwarze</name>
<email></email>
</author>
<published>2020-07-23T17:15:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=bc9c51cf66fc92815074622c1c64a0e8bd9d5796'/>
<id>urn:sha1:bc9c51cf66fc92815074622c1c64a0e8bd9d5796</id>
<content type='text'>
use-after-free and double-free issues in calling programs.
The bug was introduced in SSLeay-0.6.0 released on June 21, 1996
and has been present since OpenBSD 2.4.
I found the bug while documenting the function.

The bug could bite in two ways that looked quite different from the
perspective of the calling code:
 * If a stack was passed in that already contained some X509_INFO
   objects and an error occurred, all the objects passed in would be
   freed, but without removing the freed pointers from the stack,
   so the calling code would probable continue to access the freed
   pointers and eventually free them a second time.
 * If the input BIO contained at least two valid PEM objects followed by
   at least one PEM object causing an error, at least one freed pointer
   would be put onto the stack, even though the function would return NULL
   rather than the stack.  But the calling code would still have a pointer
   to the stack, so it would be likely to access the new bogus pointers
   sooner or later.

Fix all this by remembering the size of the input stack on entry
and cutting it back to exactly that size when exiting due to an
error, but no further.

While here, do some related cleanup:
 * Garbage collect the automatic variables "error" and "i"
   which were only used at one single place each.
 * Use NULL rather than 0 for pointers.

I like bugfixes that make the code four lines shorter, reduce the
number of variables by one, reduce the number of brace-blocks by
one, reduce the number if if-statements by one, and reduce the
number of else-clauses by one.

Tweaks and OK tb@.
</content>
</entry>
<entry>
<title>Handle CMS PEM headers.</title>
<updated>2019-09-06T17:41:05+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2019-09-06T17:41:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=6bf0ccd1f8e6e778cc2c39e96ba3f8d5c5062682'/>
<id>urn:sha1:6bf0ccd1f8e6e778cc2c39e96ba3f8d5c5062682</id>
<content type='text'>
ok inoguchi@ tb@
</content>
</entry>
<entry>
<title>Clean up pvkfmt.c</title>
<updated>2019-07-08T11:56:18+00:00</updated>
<author>
<name>inoguchi</name>
<email></email>
</author>
<published>2019-07-08T11:56:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=38918e2b1105203e3a43e4c44a53bf432952771c'/>
<id>urn:sha1:38918e2b1105203e3a43e4c44a53bf432952771c</id>
<content type='text'>
- Replace EVP_CIPHER_CTX_init with EVP_CIPHER_CTX_new and handle return value
- Replace EVP_CIPHER_CTX_cleanup with EVP_CIPHER_CTX_free
- Change two 'return -1;' to 'goto err;' for avoiding leak
- Remove the case if enclevel == 0
- Change enclevel checking to make more consistent
- Change all goto label to 'err' and insert space before goto label

ok and advise from tb@
</content>
</entry>
<entry>
<title>Fix pvk format processing in libcrypto</title>
<updated>2019-07-07T10:52:56+00:00</updated>
<author>
<name>inoguchi</name>
<email></email>
</author>
<published>2019-07-07T10:52:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=b7ed3b2ab5936f64572047d1bcd708bbdeeb5a59'/>
<id>urn:sha1:b7ed3b2ab5936f64572047d1bcd708bbdeeb5a59</id>
<content type='text'>
- Return the valid pointer in i2b_PVK()
- Use EVP_Decrypt* instead of EVP_Encrypt*
- Fix error handling after BIO_write() in i2b_PVK_bio()

ok tb@
</content>
</entry>
<entry>
<title>Change PEM_Sign{Init,Update}() to return an int.</title>
<updated>2018-08-24T19:51:31+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2018-08-24T19:51:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=bf5473ed3db3f13d45280ab553b3c593d8e311ea'/>
<id>urn:sha1:bf5473ed3db3f13d45280ab553b3c593d8e311ea</id>
<content type='text'>
tested in a bulk by sthen
ok jsing
</content>
</entry>
<entry>
<title>Check return value of EVP_EncodeUpdate() in PEM_write_bio().</title>
<updated>2018-08-24T19:48:39+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2018-08-24T19:48:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=f7f51b71b683001b12ec548a55a6c0779df009d5'/>
<id>urn:sha1:f7f51b71b683001b12ec548a55a6c0779df009d5</id>
<content type='text'>
ok jsing
</content>
</entry>
<entry>
<title>Fix memory leak in i2b_PVK in error handling.</title>
<updated>2018-08-05T11:19:25+00:00</updated>
<author>
<name>bcook</name>
<email></email>
</author>
<published>2018-08-05T11:19:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=2e290efb0ac101817d9da88a5b417f1b48cbe3fa'/>
<id>urn:sha1:2e290efb0ac101817d9da88a5b417f1b48cbe3fa</id>
<content type='text'>
Simplify parameter checks since this is only called from one place.
Found by Coverity, CID 183502.

ok beck@
</content>
</entry>
<entry>
<title>Add const qualifier to the 'name', 'header', and 'data' arguments of</title>
<updated>2018-05-13T10:47:54+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2018-05-13T10:47:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=3b290073d5397f3c36a8cdf72764dc9bed6c5ebd'/>
<id>urn:sha1:3b290073d5397f3c36a8cdf72764dc9bed6c5ebd</id>
<content type='text'>
PEM_write(3) and PEM_write_bio(3).

tested in a bulk build by sthen
ok jsing
</content>
</entry>
<entry>
<title>make ENGINE_finish() succeed on NULL and simplify callers as in</title>
<updated>2018-04-14T07:09:21+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2018-04-14T07:09:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=0c5418014797b1fadca3f270eb2f140fd6f5bdf8'/>
<id>urn:sha1:0c5418014797b1fadca3f270eb2f140fd6f5bdf8</id>
<content type='text'>
OpenSSL commit 7c96dbcdab9 by Rich Salz.

This cleans up the caller side quite a bit and reduces the number of
lines enclosed in #ifndef OPENSSL_NO_ENGINE.  codesearch.debian.net
shows that almost nothing checks the return value of ENGINE_finish().
While there, replace a few nearby 'if (!ptr)' with 'if (ptr == NULL)'.

ok jsing, tested by &amp; ok inoguchi
</content>
</entry>
</feed>
