/*
- * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
goto err;
}
if (px != NULL || py != NULL) {
- if (px != NULL)
+ if (px != NULL) {
x = BN_CTX_get(bnctx);
- if (py != NULL)
+ if (x == NULL)
+ goto err;
+ }
+ if (py != NULL) {
y = BN_CTX_get(bnctx);
+ if (y == NULL)
+ goto err;
+ }
if (!EC_POINT_get_affine_coordinates(ecg, pub_point, x, y, bnctx))
goto err;
}
p->return_size = EC_POINT_point2oct(ecg, ecp,
POINT_CONVERSION_UNCOMPRESSED,
- p->data, p->return_size, bnctx);
+ p->data, p->data_size, bnctx);
if (p->return_size == 0)
goto err;
}
gctx->libctx = libctx;
gctx->selection = selection;
gctx->ecdh_mode = 0;
- }
- if (!ec_gen_set_params(gctx, params)) {
- OPENSSL_free(gctx);
- gctx = NULL;
+ if (!ec_gen_set_params(gctx, params)) {
+ OPENSSL_free(gctx);
+ gctx = NULL;
+ }
}
return gctx;
}
{ OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME,
(void (*)(void))ec_query_operation_name },
{ OSSL_FUNC_KEYMGMT_DUP, (void (*)(void))ec_dup },
- { 0, NULL }
+ OSSL_DISPATCH_END
};
#ifndef FIPS_MODULE
{ OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME,
(void (*)(void))sm2_query_operation_name },
{ OSSL_FUNC_KEYMGMT_DUP, (void (*)(void))ec_dup },
- { 0, NULL }
+ OSSL_DISPATCH_END
};
# endif
#endif