tls-hkdf: Make labels enum a proper type
authorTobias Brunner <tobias@strongswan.org>
Tue, 25 Aug 2020 11:35:54 +0000 (13:35 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 12 Feb 2021 10:45:44 +0000 (11:45 +0100)
src/libtls/tls_hkdf.c
src/libtls/tls_hkdf.h

index d0c44f5..682dd2f 100644 (file)
@@ -356,7 +356,7 @@ METHOD(tls_hkdf_t, set_shared_secret, void,
 }
 
 METHOD(tls_hkdf_t, generate_secret, bool,
 }
 
 METHOD(tls_hkdf_t, generate_secret, bool,
-       private_tls_hkdf_t *this, enum tls_hkdf_labels_t label, chunk_t messages,
+       private_tls_hkdf_t *this, tls_hkdf_label_t label, chunk_t messages,
        chunk_t *secret)
 {
        switch (label)
        chunk_t *secret)
 {
        switch (label)
index a820b02..2f56a04 100644 (file)
 #include <library.h>
 #include <crypto/hashers/hasher.h>
 
 #include <library.h>
 #include <crypto/hashers/hasher.h>
 
+typedef enum tls_hkdf_label_t tls_hkdf_label_t;
 typedef struct tls_hkdf_t tls_hkdf_t;
 
 /**
  * TLS HKDF labels
  */
 typedef struct tls_hkdf_t tls_hkdf_t;
 
 /**
  * TLS HKDF labels
  */
-enum tls_hkdf_labels_t {
+enum tls_hkdf_label_t {
        TLS_HKDF_EXT_BINDER,
        TLS_HKDF_RES_BINDER,
        TLS_HKDF_C_E_TRAFFIC,
        TLS_HKDF_EXT_BINDER,
        TLS_HKDF_RES_BINDER,
        TLS_HKDF_C_E_TRAFFIC,
@@ -65,7 +66,7 @@ struct tls_hkdf_t {
         * @param secret                        secret will be written into this chunk, if used
         * @return                                      TRUE if secrets derived successfully
         */
         * @param secret                        secret will be written into this chunk, if used
         * @return                                      TRUE if secrets derived successfully
         */
-       bool (*generate_secret)(tls_hkdf_t *this, enum tls_hkdf_labels_t label,
+       bool (*generate_secret)(tls_hkdf_t *this, tls_hkdf_label_t label,
                                                        chunk_t messages, chunk_t *secret);
 
        /**
                                                        chunk_t messages, chunk_t *secret);
 
        /**