Commit Graph

197 Commits

Author SHA1 Message Date
Christian Hohnstaedt
89b7c6beea codespell: Fix spelling issues, no functional changes 2025-03-28 18:11:18 +01:00
Christian Hohnstaedt
2bb89cb8c0 Disable Import button when creating a new template
It does not belong there and caused a crash when pressing import and
then OK.
2024-09-29 18:39:00 +02:00
Christian Hohnstaedt
5f4308245c Close #239: Check existing Name Constraints
This check is performed before the certificate is
issued and signed. Like all the other checks
regarding validity, extensions and other things.

Issuing certificates that violate the Name Constraints
of any CA in the chain is still be possible.

But there will be a warning now with the name of the affected
CA-Certificate and the violated constraint.

The Issuer can then decide whether to issue the
certificate or not.
2024-09-29 18:39:00 +02:00
Christian Hohnstaedt
fa10ca43b5 Close #587: Incomplete refactoring of adapt_explicit_subj
Fix the "adapt_explicit_subject" in NewX509.cpp
to mathc the other occcurancxes in Options.cpp
2024-09-28 15:57:05 +02:00
Christian Hohnstaedt
8390e9588f Allow live changes during import of a template
With this change it is not necessary to open an imported
template if an imported tamplate cshall be changed.
2024-09-28 15:57:05 +02:00
Christian Hohnstaedt
2b3f4dd039 Combine #90 and #315 and support UPN in name constraints 2024-09-15 09:25:44 +02:00
Christian Hohnstaedt
cb1f02502d Close #90, #361: Name Constraints (RFC5280 section 4.2.1.10)
Some checks failed
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 5.15.2, ubuntu-latest) (push) Has been cancelled
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 6.6.2, ubuntu-latest) (push) Has been cancelled
CMake / build (build/xca-*.dmg, Unix Makefiles, mac, /opt/homebrew/opt/openssl, macos, 6.6.2, macos-latest) (push) Has been cancelled
CMake / build (build/xca-*.msi build/xca-portable-*.zip , MinGW Makefiles, windows, D:\msys2\msys64\mingw64, windows, 5.15.2, windows-2019, win64_mingw81) (push) Has been cancelled
Conversion of name constraints from certificate to Template
(Advanced Tab) and using them from there was working since long.

Now there is an additional input line, like (and next to)
SubjectAlternativeName with live validation and edit button
with guided input.

The conversion from cert to template now puts the extension
into the correct LineEdit and not on the Advanced Tab anymore.

However, XCA does NOT follow the constraints, yet.
It is still possible to issue certificates with arbitrary
names, independent of any "Name Constraints" in the CA.

This is what issue #239 asks for.
2024-09-14 23:53:59 +02:00
Christian Hohnstaedt
60ca584266 Close #315 Support UPN type for EAP/802.1X certificates
Replace "UPN:" by "otherName:msUPN;UTF8:" when generating
the extension from the Subject- and IssuerAlternativeName.

Extend the Edit dialog of the SAN and IAN by the "UPN" prefix.

Replace "otherName:msUPN;UTF8:" by "UPN:" when creating a template
from an existing certificate or request.

The OpenSSL config file export, the configuration display
and edit on the "Advanced Tab" are not afffected, since
this is an XCA syntax sugar, not supported by OpenSSL.

Update documentation
2024-09-06 10:07:51 +02:00
Christian Hohnstaedt
a9c5466ea9 Make more texts translateable 2024-04-22 19:13:02 +02:00
Christian Hohnstaedt
6a71ea218f Fix "Copy extensions from request" function
Previously the request extensions were ignored
when they also existed on one of the other tabs.

Now they are correctly listed and marked as duplicated.
2024-04-22 19:13:02 +02:00
Christian Hohnstaedt
53dfdb35e6 NewX509: use enum instead of int for clarity
No need to call "NewX509::validateExtensions" with the "nconf"
2024-04-22 19:13:02 +02:00
Christian Hohnstaedt
687dab8781 Related to #519: improve validation icon
The validation icon (check-mark or exclamation mark)
were not displayed correctly when using "email:copy" or
"issuer:copy" in the alternative names.

Setup the temporary X509V3_CTX before evaluating the
validity of "Subject Alternative Name" and "Issuer Alternative Name"
2024-02-14 22:33:45 +01:00
Christian Hohnstaedt
0c1c00962f Fix whitespace errors 2023-12-30 11:01:11 +01:00
Christian Hohnstaedt
94a1eced62 Make XCA templates viewable for import
Until now XCA templates could not be viewed during import.
But this is necessary to skip the multi-import dialog.

The NewX509 dialog is used with almost everything disabled.
2023-10-08 22:19:18 +02:00
Christian Hohnstaedt
993da2d474 Use C++11 initializers for all non-static class members
When XCA started in 2002, there were no C++ initializers.
Drop explicit initializers from the constructors.

 - Fix indentations of section declarators.
 - Replace NULL by nullptr when feasible.
 - Sort private section: properties first, then methods.
2023-10-08 22:19:18 +02:00
Christian Hohnstaedt
8662eff3ed Basic Constraints Pathlen: restrict input to postitive numbers 2023-05-25 22:19:14 +02:00
Christian Hohnstaedt
8f277ea781 x509v3_ext: Improve error-checking
Validate SAN, IAN, AIA, CRLDP during rollout.
Fix tab-switching when validating new certificate context.

Also work with X509_EXTENSION being nullptr
2023-05-25 22:18:48 +02:00
Christian Hohnstaedt
fdf48c8b5b PR #425: Refresh supported hashes after key generation
There were 2 slots to trigger the switchHashAlgo()
whenever the selected key or request changes.

But their signature for automatic connect()ion was wrong.
After fixing the methods signature, they are connected
and get called whenever the keylist changes and especially,
when a new key is inserted.
2023-05-16 09:49:46 +02:00
Christian Hohnstaedt
ced6dfc41a Add support for Qt6
XCA now supports both, Qt6 and Qt5 down to Qt-5.2

Use CMAKE_PREFIX_PATH to point to the QT dompiler directory like
$ cmake -B build -DCMAKE_PREFIX_PATH=$HOME/6.3.1/gcc_64
2022-08-31 00:09:37 +02:00
Christian Hohnstaedt
ded935b033 Prepare for Qt6: QRegExp -> QRegularExpression
QRegExp is deprecated and needs special library
in Qt6: core5compat

Replace by QRegularExpression which has been introduced by Qt5
2022-08-31 00:01:06 +02:00
Christian Hohnstaedt
c752508979 Separate XCA Warning in Cmdline and GUI 2021-09-09 21:46:30 +02:00
Christian Hohnstädt
52bf30e47b Visual Code adaptions 2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
61fa66b129 Add digest class encapsulating EVP_MD
Enables the separation of the core classes from the hashbox widget
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
5b7aa117fa NewX509: select correct help context by tab
Especially removing tabs will shuffle the numbers.
Set the help context as tab-widget objects name.
2021-05-02 23:11:22 +02:00
Christian Hohnstaedt
2eb621e6e4 NewX509: directly call the NewKey and RequestDetail dialog
instead of calling it indirectly through signal-slot
mechanism.
This way we can set ourselves as parent to work
properly with Qt::WindowModal modality.
2021-05-02 22:59:41 +02:00
Christian Hohnstaedt
ff7704ff0b Add context sensitive documentation
All dialogs get the "Qt::WindowModal" modality to
operate the Help window in parallel
while also blocking the dialog parent windows.

The manageRevocations() moved from model to view

The Details dialogs become more self-sufficient.
There is a statc start method that shows the dialog and
updates name and comment after accept().
This allows recursive starts of certificate details and
independence of mainwin.
It is necessary to set the current toplevel widget as parent
for the next dialog to not block the application.
2021-04-23 15:50:13 +02:00
Christian Hohnstädt
7f9f61c5c7 Issue a warning when using an insecure hash algorithm
md5, ripemd160 and sha1 are considered insecure.
Issue a warning if one of them is used.
2021-04-01 14:02:59 +02:00
Christian Hohnstädt
24009b13c7 Fix warnings 2020-10-14 19:48:17 +02:00
Christian Hohnstaedt
1e544161f6 Eliminate the use of "mainwin" in lib/db_* 2020-05-08 11:59:09 +02:00
Christian Hohnstaedt
7c65a786ea Revamp database management
The global variable "Database" of class xca_db
can be used by any other class to access. No need
to provide it.

The "xca_db" class managed the "database_model" pointer.
Accessing the name of the current database has been unified.
2020-05-08 07:47:15 +02:00
Christian Hohnstaedt
5a64725556 Move item store from db_base into separate class "pki_lookup"
Since also pki_base and other classes need to access them.
2020-04-30 18:37:25 +02:00
Christian Hohnstaedt
5543ec2fb8 Merge branch 'master' into develop 2020-04-02 07:35:18 +02:00
Christian Hohnstaedt
9bdbecbd9f Improve translation 2020-03-29 22:33:57 +02:00
Christian Hohnstaedt
4f1103a64f Close #72: Add checkbox for OCSP staple feature
Also support them in XCA template and transformation from
certificate and request.
2020-03-29 22:23:21 +02:00
Christian Hohnstaedt
c4eb23f2af Close #172 #46: Multiple OCSP Responders
also fixes "#46 AIA, simultaneous OCSP and caIssuers"

Move "OCSP/caIssuers" index from a separate drop down
into the single dropdown of URI/IP/DNS...

This change not only fixes the bug, but also removes some
special handling for the AIA extension.

Adding features by deleting code is highly appreciated :-)
2020-03-20 16:29:43 +01:00
Christian Hohnstaedt
0cbf179074 Close #172 #46: Multiple OCSP Responders
also fixes "#46 AIA, simultaneous OCSP and caIssuers"

Move "OCSP/caIssuers" index from a separate drop down
into the single dropdown of URI/IP/DNS...

This change not only fixes the bug, but also removes some
special handling for the AIA extension.

Adding features by deleting code is highly appreciated :-)
2020-03-18 05:26:16 +01:00
Christian Hohnstaedt
595cf9a722 Drop connNewX509() signal and slot
in the past it was used to connect the NewX509 dialog
with requests keys and certs.

The NewX509 dialog knows mainwin since some time
and thus can connect itself to models and views

mainwin: use model<T>() instead of models->model<T>()
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
ef9b3aff3d Drop superflous includes from header files 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
c89b6aff29 Move NID lists for ExtendedKeyUsage and DistinguishedName
into lib/oid.h
2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
c5208f1cd7 Consolidate headers, unguard delete operator 2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
e4d0ab8f8e Refactor Image and icon ressources 2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
113a201d39 Separate database from Mainwin for better cmdline support
New classes:
 - database_model: Manage the database tables (keys, req, cert, crl, templ)
   extracted from widgets/MW_database.cpp
 - arguments: parse commandline, dynamically create help text
2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
2fbadfc9f0 Update Copyright Years to 2020 2020-01-13 07:26:46 +01:00
Christian Hohnstaedt
ae94faebaf Transfer Key Usage and Extended Key Usage critical flags
When transforming certificate or request extensions
into a template, the (e)keyusage critical flags storage
had a typo:
  "eKyUseCritical" instead of "ekuCritical" and
  "keyUseCritical" instead of "kuCritical"

Also the eKeyUse value was not transformed completely.
2020-01-07 06:08:30 +01:00
Christian Hohnstaedt
2682edacfd Close #48 The SKI tickbox isn't generating an SKI extension for CSRs
Since the first support of extensions for CSR (2005),
the Subject Key Identifier has been skipped.
Enable it, while still removing issuer extensions.

Better fix "Automatic X509v3 extensions for CSR"
2018-07-10 23:04:47 +02:00
Christian Hohnstaedt
3c87ff1ea0 Remove code duplication with CSR information
Unstructured name and challange password use the
distinguished name code (setupExplicitInputs)
2018-06-22 06:21:37 +02:00
Christian Hohnstaedt
5703ad855a Separate the internal name from distinguished name 2018-06-22 06:20:33 +02:00
Christian Hohnstaedt
15d33fdcfc Make the dynamic DN entry adaption configurable.
If the option is selected, the behavior from the
previous commit is enabled. Otherwise, the
explicit DN entries stay as configured.
2018-06-21 20:29:45 +02:00
Christian Hohnstaedt
efa29c0e7c Inspired by #39: Dynamically adjust explicit DN entries
When editing a template or applying a template during
certificate or request generation, the explicit entries
are reordered by the current order of the template subject.

All entries that are mentioned in the explicit DN entry
configuration setting, but not part of the template DN
are appended.
2018-06-21 20:28:23 +02:00
Christian Hohnstaedt
2a0f96e810 Close #39: Subject entries shuffled
Strictly keep order of DistinguishedName entires.

This fixes a bug introduced by dcd940b6b8
 "SF Feat. Req. #57 More options for Distinguished Name"
2018-06-21 20:13:21 +02:00