Skip to content

Commit

Permalink
check typedef enums
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal authored Nov 23, 2022
1 parent f622d02 commit f1d2d12
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/checkheader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func generate(header string) (string, error) {
}
continue
}
if strings.HasPrefix(l, "enum {") {
if strings.HasPrefix(l, "enum {") || strings.HasPrefix(l, "typedef enum {") {
enum = true
continue
}
Expand Down
7 changes: 5 additions & 2 deletions openssl/openssl_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ enum {
// #include <openssl/ec.h>
enum {
GO_EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID = 0x1001,
GO_POINT_CONVERSION_UNCOMPRESSED = 4
};

typedef enum {
GO_POINT_CONVERSION_UNCOMPRESSED = 4,
} point_conversion_form_t;

// #include <openssl/obj_mac.h>
enum {
GO_NID_X9_62_prime256v1 = 415,
Expand Down Expand Up @@ -213,7 +216,7 @@ DEFINEFUNC(void, EC_GROUP_free, (GO_EC_GROUP_PTR arg0), (arg0)) \
DEFINEFUNC(GO_EC_POINT_PTR, EC_POINT_new, (const GO_EC_GROUP_PTR arg0), (arg0)) \
DEFINEFUNC(void, EC_POINT_free, (GO_EC_POINT_PTR arg0), (arg0)) \
DEFINEFUNC(int, EC_POINT_get_affine_coordinates_GFp, (const GO_EC_GROUP_PTR arg0, const GO_EC_POINT_PTR arg1, GO_BIGNUM_PTR arg2, GO_BIGNUM_PTR arg3, GO_BN_CTX_PTR arg4), (arg0, arg1, arg2, arg3, arg4)) \
DEFINEFUNC(size_t, EC_POINT_point2oct, (const GO_EC_GROUP_PTR group, const GO_EC_POINT_PTR p, int form, unsigned char *buf, size_t len, GO_BN_CTX_PTR ctx), (group, p, form, buf, len, ctx)) \
DEFINEFUNC(size_t, EC_POINT_point2oct, (const GO_EC_GROUP_PTR group, const GO_EC_POINT_PTR p, point_conversion_form_t form, unsigned char *buf, size_t len, GO_BN_CTX_PTR ctx), (group, p, form, buf, len, ctx)) \
DEFINEFUNC(int, EC_POINT_oct2point, (const GO_EC_GROUP_PTR group, GO_EC_POINT_PTR p, const unsigned char *buf, size_t len, GO_BN_CTX_PTR ctx), (group, p, buf, len, ctx)) \
DEFINEFUNC(int, EC_POINT_mul, (const GO_EC_GROUP_PTR group, GO_EC_POINT_PTR r, const GO_BIGNUM_PTR n, const GO_EC_POINT_PTR q, const GO_BIGNUM_PTR m, GO_BN_CTX_PTR ctx), (group, r, n, q, m, ctx)) \
DEFINEFUNC(GO_EC_KEY_PTR, EC_KEY_new_by_curve_name, (int arg0), (arg0)) \
Expand Down

0 comments on commit f1d2d12

Please sign in to comment.