<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-openbsd/lib/libcrypto/ui, branch master</title>
<subtitle>WireGuard implementation for the OpenBSD kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-openbsd/atom/lib/libcrypto/ui?h=master</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-openbsd/atom/lib/libcrypto/ui?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/'/>
<updated>2020-09-25T11:25:31Z</updated>
<entry>
<title>KNF for a few comments and indent a label</title>
<updated>2020-09-25T11:25:31Z</updated>
<author>
<name>tb</name>
<email>tb@openbsd.org</email>
</author>
<published>2020-09-25T11:25:31Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=a0462387a19a098323e25389a3d9ad37c8debd58'/>
<id>urn:sha1:a0462387a19a098323e25389a3d9ad37c8debd58</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove some dangling elses for consistency with the rest of the file</title>
<updated>2020-09-25T11:17:52Z</updated>
<author>
<name>tb</name>
<email>tb@openbsd.org</email>
</author>
<published>2020-09-25T11:17:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=91f12599ad5d8571f1ca4134858d27fec6247d92'/>
<id>urn:sha1:91f12599ad5d8571f1ca4134858d27fec6247d92</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Simplify UI_new_method()</title>
<updated>2020-09-25T11:05:21Z</updated>
<author>
<name>tb</name>
<email>tb@openbsd.org</email>
</author>
<published>2020-09-25T11:05:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=c4393b6d2d075231edd76cce9e8a39fe7132724c'/>
<id>urn:sha1:c4393b6d2d075231edd76cce9e8a39fe7132724c</id>
<content type='text'>
Use calloc() instead of malloc() and setting all members manually to 0.
Avoid unnecessary else branch.
</content>
</entry>
<entry>
<title>Move variable declaration to the top of UI_set_result and ditch</title>
<updated>2020-09-25T10:56:36Z</updated>
<author>
<name>tb</name>
<email>tb@openbsd.org</email>
</author>
<published>2020-09-25T10:56:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=7f00cb0d87faf1c7fed1b25c38ee4c46444e8ba3'/>
<id>urn:sha1:7f00cb0d87faf1c7fed1b25c38ee4c46444e8ba3</id>
<content type='text'>
a pointless local scope.

suggested by jsing
</content>
</entry>
<entry>
<title>The default branch of a switch somehow got moved inside of a pointless</title>
<updated>2020-09-25T10:50:26Z</updated>
<author>
<name>tb</name>
<email>tb@openbsd.org</email>
</author>
<published>2020-09-25T10:50:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=9656a3957968fc0e1f0d238b05f07417639c2462'/>
<id>urn:sha1:9656a3957968fc0e1f0d238b05f07417639c2462</id>
<content type='text'>
local scope of a case branch. Move it into the proper location.

No binary change on amd64.

"sure" jsing
</content>
</entry>
<entry>
<title>Simplify call to ERR_print_errors_cb()</title>
<updated>2020-09-25T10:46:12Z</updated>
<author>
<name>tb</name>
<email>tb@openbsd.org</email>
</author>
<published>2020-09-25T10:46:12Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=a37673fd71297aa52b95863a35da1fdc2b662dff'/>
<id>urn:sha1:a37673fd71297aa52b95863a35da1fdc2b662dff</id>
<content type='text'>
There is no reason for print_error()'s third argument to be a UI *.
It may just as well be a void * to match what ERR_print_errors_cb()
expects. This avoids casting the function pointer. Also, there's no
need for a (void *) cast.

ok jsing
</content>
</entry>
<entry>
<title>Error out if ok_chars and cancel_chars overlap</title>
<updated>2020-09-24T19:31:01Z</updated>
<author>
<name>tb</name>
<email>tb@openbsd.org</email>
</author>
<published>2020-09-24T19:31:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=56735cd36d757fef16e0c3e73fdcba79d92f2bae'/>
<id>urn:sha1:56735cd36d757fef16e0c3e73fdcba79d92f2bae</id>
<content type='text'>
It is a bit silly to push an error on the stack without erroring out,
so error out if the ok_chars and cancel_chars overlap.

ok jsing
</content>
</entry>
<entry>
<title>Fix a number of leaks in the UI_dup_* functions</title>
<updated>2020-09-24T19:29:09Z</updated>
<author>
<name>tb</name>
<email>tb@openbsd.org</email>
</author>
<published>2020-09-24T19:29:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=cc93904d4c1e6659c1fb6513fd27135772a93849'/>
<id>urn:sha1:cc93904d4c1e6659c1fb6513fd27135772a93849</id>
<content type='text'>
If any of general_allocate_{prompt,string,boolean}() fail, the
UI_dup_* functions may leak the strings they strduped beforehand.
Instead, use strdup inside these functions, so we can free as
necessary.  This makes the UI_add_* and UI_dup_* simple wrappers
around general_allocate_{string,boolean}() that differ only in
passing a Boolean that indicates whether or not to use strdup.

Make a general cleanup pass over these functions, simplify the
logic and make it overall a bit easier to follow.  While there,
use strcspn() instead of a handrolled variant.

The only changes in behavior are that ERR_R_MALLOC_FAILURE is now
pushed onto the stack a bit more often and that UI_dup_input_string()
now returns -1 on failure to dup prompt like all the other UI_dup_*
functions.  This is not a problem since the manual already documents
that errors are signaled with &lt;= 0. The only consumer of this function
according to Debian's codesearch is libp11, I sent them a PR to fix
their (already broken) error handling.

Addresses about 10 errors thrown by the LLVM static analyzer in ui/.

ok jsing
</content>
</entry>
<entry>
<title>Push ERR_R_MALLOC_FAILURE onto the error stack</title>
<updated>2020-09-24T19:24:45Z</updated>
<author>
<name>tb</name>
<email>tb@openbsd.org</email>
</author>
<published>2020-09-24T19:24:45Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=c95ba6a282693e4bb7785bb3281e553412a77ede'/>
<id>urn:sha1:c95ba6a282693e4bb7785bb3281e553412a77ede</id>
<content type='text'>
If sk_UI_STRING_new_null() fails, this must be due to a memory error,
so signal this to the user.

ok jsing
</content>
</entry>
<entry>
<title>Make free_strings() NULL safe</title>
<updated>2020-09-24T19:22:18Z</updated>
<author>
<name>tb</name>
<email>tb@openbsd.org</email>
</author>
<published>2020-09-24T19:22:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=8804eef0fd767ae65f2a945ed02d9b18e22f84ea'/>
<id>urn:sha1:8804eef0fd767ae65f2a945ed02d9b18e22f84ea</id>
<content type='text'>
ok jsing
</content>
</entry>
</feed>
