diff --git a/cmd/checkheader/main.go b/cmd/checkheader/main.go index 13232dc..002e512 100644 --- a/cmd/checkheader/main.go +++ b/cmd/checkheader/main.go @@ -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 } diff --git a/openssl/openssl_funcs.h b/openssl/openssl_funcs.h index c856ce4..46f592c 100644 --- a/openssl/openssl_funcs.h +++ b/openssl/openssl_funcs.h @@ -39,9 +39,12 @@ enum { // #include 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 enum { GO_NID_X9_62_prime256v1 = 415, @@ -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)) \