Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse _OPENBSD_SOURCE namespace on NetBSD (>=8.x) #67

Merged
merged 1 commit into from Mar 22, 2015

Conversation

krytarowski
Copy link

It enables (for now) the system-wide reallocarray(3) and strtonum(3).

@busterb
Copy link
Contributor

busterb commented Mar 8, 2015

Is NetBSD's reallocarray actually the same? It appears to be a wrapper for reallocarr now.

@krytarowski
Copy link
Author

They ought to be the same. If it behaves differently please let me know!

@tedu
Copy link

tedu commented Mar 10, 2015

The NetBSD implementation of reallocarray is dangerously broken. If either size is 0, it will free the existing pointer and return NULL. Then the caller will free the pointer again.

@jonathangray
Copy link

The NetBSD implementation of strtonum isn't implemented with strtoll either but with strtoi with base 0 which accepts leading 0x for hex and leading 0 for octal. These are different semantics to what is expected. LibreSSL Portable should stick with the compat versions for systems that don't implement functions correctly.

@krytarowski
Copy link
Author

@tedu @jonathangray thank you! I will double check it propose a fix in NetBSD for these two functions.

@krytarowski
Copy link
Author

Should be fixed.

@busterb
Copy link
Contributor

busterb commented Mar 20, 2015

To verify, what version of NetBSD should I be testing this with? Not 6.1.5 I presume. Will this be in the 7.x release or a later one?

@krytarowski
Copy link
Author

The _OPENBSD_SOURCE namespace is under development in current, it will be released as NetBSD-8.0.

We can hold a bit with the tests, I'm going to push to NetBSD additional compat functions: timingsafe_bcmp(3) and explicit_bzero(3).

The current uses of timingsafe_memcmp(3) could be replaced with timingsafe_bcmp(3) without any issue. There is no need for retaining timingsafe_memcmp(3) in LibreSSL as everywhere we check for == 0 or != 0.

@busterb busterb merged commit bbf021e into libressl:master Mar 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants