/src/open62541/plugins/crypto/ua_certificategroup_none.c
Line | Count | Source |
1 | | /* This work is licensed under a Creative Commons CCZero 1.0 Universal License. |
2 | | * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. |
3 | | * |
4 | | * Copyright 2020 (c) Julius Pfrommer, Fraunhofer IOSB |
5 | | * Copyright 2024 (c) Fraunhofer IOSB (Author: Noel Graf) |
6 | | */ |
7 | | |
8 | | #include <open62541/plugin/certificategroup_default.h> |
9 | | |
10 | | static UA_StatusCode |
11 | | verifyCertificateAllowAll(UA_CertificateGroup *certGroup, |
12 | 0 | const UA_ByteString *certificate) { |
13 | 0 | UA_LOG_WARNING(certGroup->logging, UA_LOGCATEGORY_USERLAND, |
14 | 0 | "No certificate store configured. Accepting the certificate."); |
15 | 0 | return UA_STATUSCODE_GOOD; |
16 | 0 | } |
17 | | |
18 | | static void |
19 | 1.00k | clearVerifyAllowAll(UA_CertificateGroup *certGroup) { |
20 | | |
21 | 1.00k | } |
22 | | |
23 | 1.00k | void UA_CertificateGroup_AcceptAll(UA_CertificateGroup *certGroup) { |
24 | | /* Clear the structure, as it may have already been initialized. */ |
25 | 1.00k | UA_NodeId groupId = certGroup->certificateGroupId; |
26 | 1.00k | if(certGroup->clear) |
27 | 0 | certGroup->clear(certGroup); |
28 | 1.00k | UA_NodeId_copy(&groupId, &certGroup->certificateGroupId); |
29 | 1.00k | certGroup->verifyCertificate = verifyCertificateAllowAll; |
30 | 1.00k | certGroup->clear = clearVerifyAllowAll; |
31 | 1.00k | certGroup->getTrustList = NULL; |
32 | 1.00k | certGroup->setTrustList = NULL; |
33 | 1.00k | certGroup->addToTrustList = NULL; |
34 | 1.00k | certGroup->removeFromTrustList = NULL; |
35 | 1.00k | certGroup->getRejectedList = NULL; |
36 | | certGroup->getCertificateCrls = NULL; |
37 | 1.00k | } |
38 | | |
39 | | #ifndef UA_ENABLE_ENCRYPTION |
40 | | UA_StatusCode |
41 | | UA_CertificateUtils_verifyApplicationURI(UA_RuleHandling ruleHandling, |
42 | | const UA_ByteString *certificate, |
43 | | const UA_String *applicationURI, |
44 | | UA_Logger *logger) { |
45 | | return UA_STATUSCODE_GOOD; |
46 | | } |
47 | | |
48 | | UA_StatusCode |
49 | | UA_CertificateUtils_getExpirationDate(UA_ByteString *certificate, |
50 | | UA_DateTime *expiryDateTime){ |
51 | | return UA_STATUSCODE_BADNOTSUPPORTED; |
52 | | } |
53 | | |
54 | | UA_StatusCode |
55 | | UA_CertificateUtils_getSubjectName(UA_ByteString *certificate, |
56 | | UA_String *subjectName){ |
57 | | return UA_STATUSCODE_BADNOTSUPPORTED; |
58 | | } |
59 | | |
60 | | UA_StatusCode |
61 | | UA_CertificateUtils_getThumbprint(UA_ByteString *certificate, |
62 | | UA_String *thumbprint){ |
63 | | return UA_STATUSCODE_BADNOTSUPPORTED; |
64 | | } |
65 | | |
66 | | UA_StatusCode |
67 | | UA_CertificateUtils_comparePublicKeys(const UA_ByteString *certificate1, |
68 | | const UA_ByteString *certificate2) { |
69 | | return UA_STATUSCODE_BADNOTSUPPORTED; |
70 | | } |
71 | | |
72 | | UA_StatusCode |
73 | | UA_CertificateUtils_checkKeyPair(const UA_ByteString *certificate, |
74 | | const UA_ByteString *privateKey) { |
75 | | return UA_STATUSCODE_BADNOTSUPPORTED; |
76 | | } |
77 | | |
78 | | UA_StatusCode |
79 | | UA_CertificateUtils_checkCA(const UA_ByteString *certificate) { |
80 | | return UA_STATUSCODE_BADNOTSUPPORTED; |
81 | | } |
82 | | #endif |