/src/open62541_15/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_APPLICATION, |
14 | 0 | "No certificate store configured. Accepting the certificate."); |
15 | 0 | return UA_STATUSCODE_GOOD; |
16 | 0 | } |
17 | | |
18 | | static void |
19 | 16.0k | clearVerifyAllowAll(UA_CertificateGroup *certGroup) { |
20 | | |
21 | 16.0k | } |
22 | | |
23 | 16.0k | void UA_CertificateGroup_AcceptAll(UA_CertificateGroup *certGroup) { |
24 | | /* Clear the structure, as it may have already been initialized. */ |
25 | 16.0k | UA_NodeId groupId = certGroup->certificateGroupId; |
26 | 16.0k | if(certGroup->clear) |
27 | 0 | certGroup->clear(certGroup); |
28 | 16.0k | UA_NodeId_copy(&groupId, &certGroup->certificateGroupId); |
29 | 16.0k | certGroup->verifyCertificate = verifyCertificateAllowAll; |
30 | 16.0k | certGroup->clear = clearVerifyAllowAll; |
31 | 16.0k | certGroup->getTrustList = NULL; |
32 | 16.0k | certGroup->setTrustList = NULL; |
33 | 16.0k | certGroup->addToTrustList = NULL; |
34 | 16.0k | certGroup->removeFromTrustList = NULL; |
35 | 16.0k | certGroup->getRejectedList = NULL; |
36 | | certGroup->getCertificateCrls = NULL; |
37 | 16.0k | } |
38 | | |
39 | | #ifndef UA_ENABLE_ENCRYPTION |
40 | | UA_StatusCode |
41 | | UA_CertificateUtils_verifyApplicationUri(const UA_ByteString *certificate, |
42 | | const UA_String *applicationURI) { |
43 | | return UA_STATUSCODE_GOOD; |
44 | | } |
45 | | |
46 | | UA_StatusCode |
47 | | UA_CertificateUtils_getExpirationDate(UA_ByteString *certificate, |
48 | | UA_DateTime *expiryDateTime){ |
49 | | return UA_STATUSCODE_BADNOTSUPPORTED; |
50 | | } |
51 | | |
52 | | UA_StatusCode |
53 | | UA_CertificateUtils_getSubjectName(UA_ByteString *certificate, |
54 | | UA_String *subjectName){ |
55 | | return UA_STATUSCODE_BADNOTSUPPORTED; |
56 | | } |
57 | | |
58 | | UA_StatusCode |
59 | | UA_CertificateUtils_getThumbprint(UA_ByteString *certificate, |
60 | | UA_String *thumbprint){ |
61 | | return UA_STATUSCODE_BADNOTSUPPORTED; |
62 | | } |
63 | | |
64 | | UA_StatusCode |
65 | | UA_CertificateUtils_comparePublicKeys(const UA_ByteString *certificate1, |
66 | | const UA_ByteString *certificate2) { |
67 | | return UA_STATUSCODE_BADNOTSUPPORTED; |
68 | | } |
69 | | |
70 | | UA_StatusCode |
71 | | UA_CertificateUtils_checkKeyPair(const UA_ByteString *certificate, |
72 | | const UA_ByteString *privateKey) { |
73 | | return UA_STATUSCODE_BADNOTSUPPORTED; |
74 | | } |
75 | | |
76 | | UA_StatusCode |
77 | | UA_CertificateUtils_checkCA(const UA_ByteString *certificate) { |
78 | | return UA_STATUSCODE_BADNOTSUPPORTED; |
79 | | } |
80 | | #endif |