OpenBSD CVS

CVS log for src/usr.bin/openssl/ca.c


[BACK] Up to [local] / src / usr.bin / openssl

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.58 / (download) - annotate - [select for diffs], Sun Feb 4 13:08:29 2024 UTC (3 months, 1 week ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.57: +1 -2 lines
Diff to previous 1.57 (colored)

Zap a useless comment followed by a stray semicolon

Noticed by Christian Andersen

Revision 1.57 / (download) - annotate - [select for diffs], Mon Nov 13 12:43:08 2023 UTC (6 months ago) by tb
Branch: MAIN
Changes since 1.56: +3 -23 lines
Diff to previous 1.56 (colored)

Kill last user of ASN1_time_parse() in the tree

ASN1_time_parse() was useful while OpenSSL didn't have something sort of
equivalent, but now they do. Let's retire ASN1_time_parse() to internal.
This will require some patching in ports, but shrug.

ok beck

Revision 1.56 / (download) - annotate - [select for diffs], Sun Jul 2 07:08:57 2023 UTC (10 months, 2 weeks ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.55: +27 -18 lines
Diff to previous 1.55 (colored)

Teach openssl ca about Ed25519 certificates

This adds a few logic curlies to end up setting the EVP_MD to EVP_md_null()
as required by the API. This way ASN1_item_sign() now knows how to behave.

"ok = (rv == 2);" beck

Revision 1.55 / (download) - annotate - [select for diffs], Mon Mar 6 14:32:05 2023 UTC (14 months, 2 weeks ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.54: +259 -259 lines
Diff to previous 1.54 (colored)

Rename struct ${app}_config to plain cfg

All the structs are static and we need to reach into them many times.
Having a shorter name is more concise and results in less visual clutter.
It also avoids many overlong lines and we will be able to get rid of some
unfortunate line wrapping down the road.

Discussed with jsing

Revision 1.54 / (download) - annotate - [select for diffs], Fri Nov 11 17:07:38 2022 UTC (18 months, 1 week ago) by joshua
Branch: MAIN
Changes since 1.53: +4 -6 lines
Diff to previous 1.53 (colored)

Remove the legacy interactive mode from openssl(1).

This removes the legacy interactive mode from openssl(1) since it is
rarely used, complicates the code, and has also been removed from
OpenSSL in version 3.x.x.

ok tb@ jsing@

Revision 1.53 / (download) - annotate - [select for diffs], Thu Feb 3 17:44:04 2022 UTC (2 years, 3 months ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.52: +6 -14 lines
Diff to previous 1.52 (colored)

Use X509_*get0_pubkey() wherever possible to simplify and clean up
the code. Also add error checking where possible.

ok jsing

Revision 1.52 / (download) - annotate - [select for diffs], Sun Nov 21 22:34:30 2021 UTC (2 years, 5 months ago) by tb
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

Tweak for opaque EVP_MD: use EVP_MD_type(dgst) instead of dgst->type.

Revision 1.51 / (download) - annotate - [select for diffs], Sat Oct 23 12:00:18 2021 UTC (2 years, 6 months ago) by tb
Branch: MAIN
Changes since 1.50: +3 -5 lines
Diff to previous 1.50 (colored)

Stop reaching into structs that will become opaque in ca.c

"just commit it" beck

Revision 1.50 / (download) - annotate - [select for diffs], Fri Oct 22 09:44:30 2021 UTC (2 years, 6 months ago) by tb
Branch: MAIN
Changes since 1.49: +1 -2 lines
Diff to previous 1.49 (colored)

Stop setting enc.modified manually. It's no longer needed.

Revision 1.49 / (download) - annotate - [select for diffs], Sun Sep 5 04:05:14 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.48: +2 -8 lines
Diff to previous 1.48 (colored)

Remove unused variable tmptm in do_body of openssl(1) ca

Revision 1.48 / (download) - annotate - [select for diffs], Sun Sep 5 01:55:54 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.47: +30 -1 lines
Diff to previous 1.47 (colored)

Using serial number instead as subject if it is empty in openssl(1) ca

This allows multiple entries without a subject even if unique_subject == yes.
Referred to OpenSSL commit 5af88441 and arranged for our codebase.

ok tb@

Revision 1.47 / (download) - annotate - [select for diffs], Sun Sep 5 01:49:42 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.46: +10 -5 lines
Diff to previous 1.46 (colored)

Check extensions before setting version to v3

Referred to OpenSSL commit 4881d849 and arranged for our codebase.

comment and ok from tb@

Revision 1.46 / (download) - annotate - [select for diffs], Sun Sep 5 01:33:18 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.45: +10 -20 lines
Diff to previous 1.45 (colored)

Use accessor method rather than direct X509 structure access

Referred to OpenSSL commit a8d8e06b and arranged for our codebase.

comment and ok from tb@

Revision 1.45 / (download) - annotate - [select for diffs], Thu Sep 2 11:37:44 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.44: +16 -16 lines
Diff to previous 1.44 (colored)

Use defined constants

Revision 1.44 / (download) - annotate - [select for diffs], Thu Sep 2 11:07:56 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.43: +106 -105 lines
Diff to previous 1.43 (colored)

Move subject check process after the subject edit process

Referred to OpenSSL commit 2cedf794 and arranged for our codebase.

ok tb@

Revision 1.43 / (download) - annotate - [select for diffs], Mon Aug 30 12:25:54 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.42: +8 -6 lines
Diff to previous 1.42 (colored)

Clean up end of do_body in openssl(1) ca

suggested from tb@

Revision 1.42 / (download) - annotate - [select for diffs], Mon Aug 30 12:12:11 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.41: +25 -41 lines
Diff to previous 1.41 (colored)

Remove NULL check before free in openssl(1) ca

ok tb@

Revision 1.41 / (download) - annotate - [select for diffs], Sat Aug 28 05:30:09 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.40: +5 -3 lines
Diff to previous 1.40 (colored)

Check X509_get_notAfter return value in openssl(1) ca.c

Revision 1.40 / (download) - annotate - [select for diffs], Sat Aug 28 05:14:30 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.39: +4 -11 lines
Diff to previous 1.39 (colored)

Use strndup instead of malloc, memcpy and NULL termination in openssl(1) ca.c

suggested from tb@ for do_updatedb(),
and applied the same for do_body() and do_revoke().

Revision 1.39 / (download) - annotate - [select for diffs], Sat Aug 28 04:02:20 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.38: +7 -15 lines
Diff to previous 1.38 (colored)

Remove ASN1_TIME_new and use NULL for X509_gmtime_adj, free tmptm in err path

comments from tb@

Revision 1.38 / (download) - annotate - [select for diffs], Sat Aug 28 02:40:17 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.37: +3 -5 lines
Diff to previous 1.37 (colored)

Unwrap lines in openssl(1) ca.c

suggested from tb@

Revision 1.37 / (download) - annotate - [select for diffs], Sat Aug 28 02:24:10 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.36: +3 -1 lines
Diff to previous 1.36 (colored)

Avoid leak with X509_REVOKED variable in openssl(1) ca.c

pointed out by tb@

Revision 1.36 / (download) - annotate - [select for diffs], Sat Aug 28 02:11:18 2021 UTC (2 years, 8 months ago) by inoguchi
Branch: MAIN
Changes since 1.35: +127 -41 lines
Diff to previous 1.35 (colored)

Checking the return value in openssl(1) ca.c

Some functions are used without verifying the return value in openssl(1) ca.
This diff adds checking for the function return value.
With this diff, I changed return value of the write_new_certificate from void
to int to return the condition to the caller.

ok and comments from tb@

Revision 1.35 / (download) - annotate - [select for diffs], Sat Jul 24 13:21:04 2021 UTC (2 years, 9 months ago) by inoguchi
Branch: MAIN
Changes since 1.34: +6 -6 lines
Diff to previous 1.34 (colored)

Compare strcmp and strcasecmp return value with zero

Revision 1.34 / (download) - annotate - [select for diffs], Tue Jul 20 12:04:53 2021 UTC (2 years, 10 months ago) by inoguchi
Branch: MAIN
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

Check pointer variable if it is NULL in ca.c

missed with r1.32

Revision 1.33 / (download) - annotate - [select for diffs], Thu Jul 15 12:41:49 2021 UTC (2 years, 10 months ago) by inoguchi
Branch: MAIN
Changes since 1.32: +154 -83 lines
Diff to previous 1.32 (colored)

Wrap over 80 long lines in ca.c

Revision 1.32 / (download) - annotate - [select for diffs], Thu Jul 15 11:43:27 2021 UTC (2 years, 10 months ago) by inoguchi
Branch: MAIN
Changes since 1.31: +58 -58 lines
Diff to previous 1.31 (colored)

Explicitly check pointer variable if it is NULL or not in ca.c

Revision 1.31 / (download) - annotate - [select for diffs], Thu Jul 15 10:26:43 2021 UTC (2 years, 10 months ago) by inoguchi
Branch: MAIN
Changes since 1.30: +56 -56 lines
Diff to previous 1.30 (colored)

Remove space between '*' and pointer variable in ca.c

Revision 1.30 / (download) - annotate - [select for diffs], Thu Jul 15 10:15:22 2021 UTC (2 years, 10 months ago) by inoguchi
Branch: MAIN
Changes since 1.29: +19 -19 lines
Diff to previous 1.29 (colored)

Use 'serial' rather than 'ser' in ca.c

input from jsing@

Revision 1.29 / (download) - annotate - [select for diffs], Thu Jul 15 09:56:32 2021 UTC (2 years, 10 months ago) by inoguchi
Branch: MAIN
Changes since 1.28: +643 -456 lines
Diff to previous 1.28 (colored)

Convert openssl(1) ca option handling

New option handling for openssl(1) ca.
This diff is just replacing with new option handling, no functional change.
I'm using the word DN or RDN in description as manual uses them, rather than
replacing with "Distinguished Name" or "Relative Distinguished Name".

I would like to add another fixes below by follow-up diffs.
- remove space between '*' and pointer variable
- wrap 80+ long lines
- explicitly check pointer variable if it is NULL or not

comments and ok from jsing@

Revision 1.28 / (download) - annotate - [select for diffs], Wed Dec 16 18:53:10 2020 UTC (3 years, 5 months ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

Remove a redundant memset call.

Revision 1.27 / (download) - annotate - [select for diffs], Wed Jul 3 03:24:02 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

snprintf/vsnprintf return < 0 on error, rather than -1.

Revision 1.26 / (download) - annotate - [select for diffs], Wed Feb 7 05:47:55 2018 UTC (6 years, 3 months ago) by jsing
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.25: +12 -12 lines
Diff to previous 1.25 (colored)

Indent labels with a single space so that diff prototypes are more useful.

Revision 1.25 / (download) - annotate - [select for diffs], Mon May 8 21:12:36 2017 UTC (7 years ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.24: +5 -27 lines
Diff to previous 1.24 (colored)

simplify startdate/enddate validation
ok jsing@

Revision 1.24 / (download) - annotate - [select for diffs], Thu May 4 12:36:13 2017 UTC (7 years ago) by beck
Branch: MAIN
Changes since 1.23: +56 -16 lines
Diff to previous 1.23 (colored)

Fix the ca command so that certs it generates have RFC5280 conformant time.
Problem noticed by Harald Dunkel <harald.dunkel@aixigo.de>

Revision 1.23 / (download) - annotate - [select for diffs], Fri Jan 20 08:57:11 2017 UTC (7 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

rearrange pledge promises into the canonical order; easier to eyeball

Revision 1.22 / (download) - annotate - [select for diffs], Wed Aug 31 11:42:09 2016 UTC (7 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.21: +4 -27 lines
Diff to previous 1.21 (colored)

We don't need any VMS access tricks.
ok beck tedu

Revision 1.21 / (download) - annotate - [select for diffs], Tue Aug 30 11:32:28 2016 UTC (7 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.20: +14 -15 lines
Diff to previous 1.20 (colored)

buf[][] with strange use all over the place is ridiculous, especially
if buf[1] is never used.
ok guenther beck

Revision 1.20 / (download) - annotate - [select for diffs], Thu Dec 24 16:54:37 2015 UTC (8 years, 4 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

more e-mail -> email

Revision 1.19 / (download) - annotate - [select for diffs], Sat Oct 17 15:00:11 2015 UTC (8 years, 7 months ago) by doug
Branch: MAIN
Changes since 1.18: +4 -2 lines
Diff to previous 1.18 (colored)

Exit if a pledge call fails in non-interactive mode.

ok semarie@

Revision 1.18 / (download) - annotate - [select for diffs], Sat Oct 17 07:51:10 2015 UTC (8 years, 7 months ago) by semarie
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

add "tty" for several subcommands of openssl

it is needed in order to let libssl UI_* function plays with echo on/off when
asking for password on terminal.

passwd subcommand needs additionnal "wpath cpath" in order to let it calls
fopen("/dev/tty", "w") (O_WRONLY with O_CREAT | O_TRUNC).

problem reported by several
with and ok doug@

Revision 1.17 / (download) - annotate - [select for diffs], Sat Oct 10 22:28:51 2015 UTC (8 years, 7 months ago) by doug
Branch: MAIN
Changes since 1.16: +6 -1 lines
Diff to previous 1.16 (colored)

Initial support for pledges in openssl(1) commands.

openssl(1) has two mechanisms for operating: either a single execution
of one command (looking at argv[0] or argv[1]) or as an interactive
session than may execute any number of commands.

We already have a top level pledge that should cover all commands
and that's what interactive mode must continue using.  However, we can
tighten up the pledges when only executing one command.

This is an initial stab at support and may contain regressions.  Most
commands only need "stdio rpath wpath cpath".  The pledges could be
further restricted by evaluating the situation after parsing options.

deraadt@ and beck@ are roughly fine with this approach.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Sep 21 13:31:26 2015 UTC (8 years, 7 months ago) by bcook
Branch: MAIN
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

add a couple of missing NULL checks

noted by Bill Parker (dogbert2) on github

Revision 1.15 / (download) - annotate - [select for diffs], Mon Sep 21 13:13:06 2015 UTC (8 years, 7 months ago) by bcook
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

remove vestigial bits of sha-0 and md2 from openssl(1)

Noted by kinichiro on github. We probably need a better way to indicate the
list of message digests that are allowed, as the current ones are nowhere near
exhaustive (sigh - guenther@)

OK guenther@ jmc@

Revision 1.14 / (download) - annotate - [select for diffs], Sat Sep 12 19:34:07 2015 UTC (8 years, 8 months ago) by lteo
Branch: MAIN
Changes since 1.13: +1 -3 lines
Diff to previous 1.13 (colored)

Nuke SSLEAY_CONF -- a backwards compatibility environment variable that
has been superseded by OPENSSL_CONF and discouraged from use for almost
16 years.

"Definately ok" jsing@
"burn it" deraadt@
"Kill it with fire" miod@
"KILL IT WITH FIRE!!! BURN!!!!" beck@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Sep 11 18:07:06 2015 UTC (8 years, 8 months ago) by beck
Branch: MAIN
Changes since 1.12: +15 -6 lines
Diff to previous 1.12 (colored)

fix unchecked mallocs - coverity 130454 and 130455
ok jsing@

Revision 1.12 / (download) - annotate - [select for diffs], Fri Sep 11 14:30:23 2015 UTC (8 years, 8 months ago) by bcook
Branch: MAIN
Changes since 1.11: +9 -27 lines
Diff to previous 1.11 (colored)

Remove engine command and parameters from openssl(1).

We do not have any builtin or dynamic engines, meaning openssl(1) has
no way to use the engine command or parameters at all.

ok jsing@

Revision 1.11 / (download) - annotate - [select for diffs], Thu Sep 10 16:01:06 2015 UTC (8 years, 8 months ago) by jsing
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

Correct spelling of OPENSSL_cleanse.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Sep 10 02:17:17 2015 UTC (8 years, 8 months ago) by lteo
Branch: MAIN
Changes since 1.9: +1 -6 lines
Diff to previous 1.9 (colored)

Remove unused defines.  No binary change.

ok deraadt@ miod@

Revision 1.9 / (download) - annotate - [select for diffs], Sat Aug 22 16:36:05 2015 UTC (8 years, 8 months ago) by jsing
Branch: MAIN
Changes since 1.8: +1 -3 lines
Diff to previous 1.8 (colored)

Remove all duplicate prototypes for *_main functions (these are already
provided by progs.h). Also, move the FUNCTION type (and flags) into
openssl.c since that is the only place of use. Lastly, remove pointless
'extern' from the prototypes and use char **argv instead of char *argv[]
(the former is used elsewhere).

ok deraadt@ doug@

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jul 22 15:52:32 2015 UTC (8 years, 9 months ago) by jsing
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.7: +1 -5 lines
Diff to previous 1.7 (colored)

Revert ca.c r1.7 - BN_to_ASN1_INTEGER() only allocates an ASN.1 integer
when it is not passed a reference to one. In this case, it is passed a
reference to an ASN.1 integer that is part of the X509 ASN.1 data
structure. Freeing this causes bad things to happen, since it is used and
then freed later on.

Found the hard way by kinichiro inoguchi.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Jul 19 05:50:47 2015 UTC (8 years, 10 months ago) by doug
Branch: MAIN
Changes since 1.6: +6 -2 lines
Diff to previous 1.6 (colored)

Free memory when finished.

Fixes coverity 78835.

ok bcook@

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jul 19 01:10:25 2015 UTC (8 years, 10 months ago) by doug
Branch: MAIN
Changes since 1.5: +1 -4 lines
Diff to previous 1.5 (colored)

Remove effectively unused variable.

Fixes Coverity issue 21693.

ok beck@ bcook@

Revision 1.5 / (download) - annotate - [select for diffs], Sun Feb 8 10:22:45 2015 UTC (9 years, 3 months ago) by doug
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.4: +1 -13 lines
Diff to previous 1.4 (colored)

Delete commented out code from openssl(1) apps.

From OpenSSL commits:

6f91b017bbb7140f816721141ac156d1b828a6b3
75d0ebef2aef7a2c77b27575b8da898e22f3ccd5
a2b18e657ea1a932d125154f4e13ab2258796d90

ok miod@, jsing@

Revision 1.4 / (download) - annotate - [select for diffs], Sat Feb 7 04:09:43 2015 UTC (9 years, 3 months ago) by bcook
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

Modify BSIZE to BUFLEN to avoid redefinition on HP-UX.

HP-UX defines BSIZE in its <sys/param.h>, and there is a route where its
getting included as a side-effect. I tracked back to at least from HP-UX 9.0
ca. 1993, up to the latest, so the user namespace is polluted.

from kinichiro <kinichiro.inoguchi@gmail.com>

ok miod@, jsing@

Revision 1.3 / (download) - annotate - [select for diffs], Mon Sep 1 20:54:37 2014 UTC (9 years, 8 months ago) by doug
Branch: MAIN
Changes since 1.2: +7 -7 lines
Diff to previous 1.2 (colored)

Enable -Wshadow in openssl(1) and fix a few shadow warnings.

ok jsing@

Revision 1.2 / (download) - annotate - [select for diffs], Thu Aug 28 14:23:52 2014 UTC (9 years, 8 months ago) by jsing
Branch: MAIN
Changes since 1.1: +1 -2 lines
Diff to previous 1.1 (colored)

openssl_setup() calls SSL_load_error_strings(), which happens to call
ERR_load_crypto_strings() - as such, we do not need to call the same
function from most of the applications.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Aug 26 17:47:24 2014 UTC (9 years, 8 months ago) by jsing
Branch: MAIN

Move openssl(1) from /usr/sbin/openssl to /usr/bin/openssl, since it is not
a system/superuser binary. At the same time, move the source code from its
current lib/libssl/src/apps location to a more appropriate home under
usr.bin/openssl.

ok deraadt@ miod@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.