]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
pki: Fix enum for SCEP CA capabilities
authorTobias Brunner <tobias@strongswan.org>
Fri, 17 Mar 2023 16:24:41 +0000 (17:24 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 21 Mar 2023 15:11:49 +0000 (16:11 +0100)
As indicated by the comparisons and the parsing in scep_parse_caps()
this should be a bitmask.

Fixes: 7c7a5a0260ca ("pki: Enroll an X.509 certificate with a SCEP server")
Closes strongswan/strongswan#1607

src/pki/scep/scep.h

index 4e9711013647056b748b5d5bc84c842e907085e9..12f994357a599cf22cc0b48c308ce97f3a064c7c 100644 (file)
@@ -75,17 +75,17 @@ typedef struct {
 
 /* SCEP CA Capabilities */
 typedef enum {
-       SCEP_CAPS_AES =              0,
-       SCEP_CAPS_DES3 =             1,
-       SCEP_CAPS_SHA256 =           2,
-       SCEP_CAPS_SHA384 =           3,
-       SCEP_CAPS_SHA512 =           4,
-       SCEP_CAPS_SHA224 =           5,
-       SCEP_CAPS_SHA1 =             6,
-       SCEP_CAPS_POSTPKIOPERATION = 7,
-       SCEP_CAPS_SCEPSTANDARD =     8,
-       SCEP_CAPS_GETNEXTCACERT =    9,
-       SCEP_CAPS_RENEWAL =         10
+       SCEP_CAPS_AES =              (1<<0),
+       SCEP_CAPS_DES3 =             (1<<1),
+       SCEP_CAPS_SHA256 =           (1<<2),
+       SCEP_CAPS_SHA384 =           (1<<3),
+       SCEP_CAPS_SHA512 =           (1<<4),
+       SCEP_CAPS_SHA224 =           (1<<5),
+       SCEP_CAPS_SHA1 =             (1<<6),
+       SCEP_CAPS_POSTPKIOPERATION = (1<<7),
+       SCEP_CAPS_SCEPSTANDARD =     (1<<8),
+       SCEP_CAPS_GETNEXTCACERT =    (1<<9),
+       SCEP_CAPS_RENEWAL =          (1<<10),
 } scep_caps_t;
 
 extern const scep_attributes_t empty_scep_attributes;