diff options
author | Omar Polo <op@omarpolo.com> | 2023-08-23 17:38:49 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2023-08-23 17:38:49 +0000 |
commit | f9ab77a898ec008a445b3842afc21bb4eac60657 (patch) | |
tree | cda8d17e07830f7d299a59901c2f8211353f094f /have | |
parent | 9019e55e7ef1369c37f5a7d4c7b0e441d55d6b44 (diff) |
bundle libtls
gmid (like all other daemons that want to do privsep crypto) has a
very close relationship with libtls and need to stay in sync with
it.
OpenBSD' libtls was recently changed to use OpenSSL' EC_KEY_METHOD
instead of the older ECDSA_METHOD, on the gmid side we have to do
the same otherwise failures happens at runtime. In a similar manner,
privsep crypto is silently broken in the current libretls (next
version should fix it.)
The proper solution would be to complete the signer APIs so that
applications don't need to dive into the library' internals, but
that's a mid-term goal, for the immediate bundling the 'little'
libtls is the lesser evil.
The configure script has gained a new (undocumented for the time
being) flag `--with-libtls=bundled|system' to control which libtls
to use. It defaults to `bundled' except for OpenBSD where it uses
the `system' one. Note that OpenBSD versions before 7.3 (inclusive)
ought to use --with-libtls=bundled too since they still do ECDSA_METHOD.
Diffstat (limited to 'have')
-rw-r--r-- | have/ASN1_time_parse.c | 26 | ||||
-rw-r--r-- | have/ASN1_time_tm_cmp.c | 26 | ||||
-rw-r--r-- | have/Makefile | 11 | ||||
-rw-r--r-- | have/SSL_CTX_load_verify_mem.c | 24 | ||||
-rw-r--r-- | have/SSL_CTX_use_certificate_chain_mem.c | 24 | ||||
-rw-r--r-- | have/X509_LOOKUP_mem.c | 24 | ||||
-rw-r--r-- | have/arc4random.c | 23 | ||||
-rw-r--r-- | have/arc4random_buf.c | 26 | ||||
-rw-r--r-- | have/getentropy.c | 26 | ||||
-rw-r--r-- | have/timingsafe_memcmp.c | 26 |
10 files changed, 235 insertions, 1 deletions
diff --git a/have/ASN1_time_parse.c b/have/ASN1_time_parse.c new file mode 100644 index 0000000..abc7d5b --- /dev/null +++ b/have/ASN1_time_parse.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Omar Polo <op@omarpolo.com> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include <stdlib.h> + +#include <openssl/asn1.h> + +int +main(void) +{ + return ASN1_time_parse("", 0, NULL, 0); +} + diff --git a/have/ASN1_time_tm_cmp.c b/have/ASN1_time_tm_cmp.c new file mode 100644 index 0000000..807c97d --- /dev/null +++ b/have/ASN1_time_tm_cmp.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Omar Polo <op@omarpolo.com> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include <stdlib.h> + +#include <openssl/asn1.h> + +int +main(void) +{ + return ASN1_time_tm_cmp(NULL, NULL); +} + diff --git a/have/Makefile b/have/Makefile index 21e75c4..d2a1dfa 100644 --- a/have/Makefile +++ b/have/Makefile @@ -1,10 +1,18 @@ -DISTFILES = Makefile \ +DISTFILES = ASN1_time_parse.c \ + ASN1_time_tm_clamp_notafter.c \ + ASN1_time_tm_cmp.c \ + Makefile \ + SSL_CTX_load_verify_mem.c \ + SSL_CTX_use_certificate_chain_mem.c \ + X509_LOOKUP_mem.c \ + arc4random.c \ endian_h.c \ err.c \ explicit_bzero.c \ freezero.c \ getdtablecount.c \ getdtablesize.c \ + getentropy.c \ getprogname.c \ imsg.c \ libevent.c \ @@ -24,6 +32,7 @@ DISTFILES = Makefile \ strlcat.c \ strlcpy.c \ strtonum.c \ + timingsafe_memcmp.c \ tree_h.c \ vasprintf.c \ vis.c \ diff --git a/have/SSL_CTX_load_verify_mem.c b/have/SSL_CTX_load_verify_mem.c new file mode 100644 index 0000000..32ef15b --- /dev/null +++ b/have/SSL_CTX_load_verify_mem.c @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023 Omar Polo <op@omarpolo.com> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include <stdio.h> +#include <openssl/ssl.h> + +int +main(void) +{ + return SSL_CTX_load_verify_mem(NULL, NULL, 0); +} diff --git a/have/SSL_CTX_use_certificate_chain_mem.c b/have/SSL_CTX_use_certificate_chain_mem.c new file mode 100644 index 0000000..0e45c31 --- /dev/null +++ b/have/SSL_CTX_use_certificate_chain_mem.c @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023 Omar Polo <op@omarpolo.com> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include <stdio.h> +#include <openssl/ssl.h> + +int +main(void) +{ + return SSL_CTX_use_certificate_chain_mem(NULL, NULL, 0); +} diff --git a/have/X509_LOOKUP_mem.c b/have/X509_LOOKUP_mem.c new file mode 100644 index 0000000..3df485e --- /dev/null +++ b/have/X509_LOOKUP_mem.c @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023 Omar Polo <op@omarpolo.com> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include <stdio.h> +#include <openssl/x509_vfy.h> + +int +main(void) +{ + return X509_LOOKUP_mem() != NULL; +} diff --git a/have/arc4random.c b/have/arc4random.c new file mode 100644 index 0000000..4d3d48b --- /dev/null +++ b/have/arc4random.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 Omar Polo <op@omarpolo.com> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include <stdlib.h> + +int +main(void) +{ + return arc4random(); +} diff --git a/have/arc4random_buf.c b/have/arc4random_buf.c new file mode 100644 index 0000000..450ab9c --- /dev/null +++ b/have/arc4random_buf.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Omar Polo <op@omarpolo.com> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include <stdlib.h> + +int +main(void) +{ + char buf[128]; + + arc4random_buf(buf, sizeof(buf)); + return 0; +} diff --git a/have/getentropy.c b/have/getentropy.c new file mode 100644 index 0000000..46cd74d --- /dev/null +++ b/have/getentropy.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Omar Polo <op@omarpolo.com> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include <stdio.h> +#include <unistd.h> + +int +main(void) +{ + char buf[1024]; + + return getentropy(buf, sizeof(buf)); +} diff --git a/have/timingsafe_memcmp.c b/have/timingsafe_memcmp.c new file mode 100644 index 0000000..0922d4b --- /dev/null +++ b/have/timingsafe_memcmp.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Omar Polo <op@omarpolo.com> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include <string.h> + +int +main(void) +{ + const char *a = "foo"; + const char *b = "bar"; + + return timingsafe_memcmp(a, b, 3); +} |