Message ID | 20220726115100.31449-1-selva.nair@gmail.com |
---|---|
State | Changes Requested |
Headers | show |
Series | [Openvpn-devel] xkey_provider: fix building with --disable-management | expand |
Hi, On Tue, Jul 26, 2022 at 07:51:00AM -0400, selva.nair@gmail.com wrote: > From: Selva Nair <selva.nair@gmail.com> > > Signed-off-by: Selva Nair <selva.nair@gmail.com> > --- > src/openvpn/xkey_helper.c | 4 ++++ > 1 file changed, 4 insertions(+) Close ;-) This fixes compilation of xkey_helper.c for --disable-management, but "make check" still fails in test_provider.c In file included from test_provider.c:38: test_provider.c: In function 'init_test': test_provider.c:130:36: error: invalid application of 'sizeof' to incomplete type 'struct management' 130 | management = test_calloc(sizeof(*management), 1); | ^ test_provider.c: In function 'xkey_provider_test_mgmt_sign_cb': test_provider.c:290:19: error: invalid use of undefined type 'struct management' 290 | management->settings.flags = MF_EXTERNAL_KEY|MF_EXTERNAL_KEY_PSSPAD; | ^~ test_provider.c:290:38: error: 'MF_EXTERNAL_KEY' undeclared (first use in this function) 290 | management->settings.flags = MF_EXTERNAL_KEY|MF_EXTERNAL_KEY_PSSPAD; | ^~~~~~~~~~~~~~~ (and a few more) ... can I have a v2, please? thanks ;-) gert
diff --git a/src/openvpn/xkey_helper.c b/src/openvpn/xkey_helper.c index 81dd71dc..27e87d79 100644 --- a/src/openvpn/xkey_helper.c +++ b/src/openvpn/xkey_helper.c @@ -85,6 +85,7 @@ xkey_digest(const unsigned char *src, size_t srclen, unsigned char *buf, return 1; } +#ifdef ENABLE_MANAGEMENT /** * Load external key for signing via management interface. * The public key must be passed in by the caller as we may not @@ -107,6 +108,7 @@ xkey_load_management_key(OSSL_LIB_CTX *libctx, EVP_PKEY *pubkey) return xkey_load_generic_key(libctx, dummy, pubkey, sign_op, NULL); } +#endif /** * Load a generic key into the xkey provider. @@ -147,6 +149,7 @@ xkey_load_generic_key(OSSL_LIB_CTX *libctx, void *handle, EVP_PKEY *pubkey, return pkey; } +#ifdef ENABLE_MANAGEMENT /** * Signature callback for xkey_provider with management-external-key * @@ -277,6 +280,7 @@ xkey_management_sign(void *unused, unsigned char *sig, size_t *siglen, return (*siglen > 0); } +#endif /* ENABLE MANAGEMENT */ /** * Add PKCS1 DigestInfo to tbs and return the result in *enc.