• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zhaozg / lua-openssl / 25776463823

13 May 2026 03:28AM UTC coverage: 91.231% (-2.6%) from 93.832%
25776463823

Pull #408

travis-ci

zhaozg
feat(pqc): Phase 2.4 - Provider Management for PQC

Add PQC provider management capabilities to the provider module:

- Add `provider.query_pqc_algorithms()` to probe and list available PQC
  algorithms by attempting key generation for known PQC algorithm names
- Add `provider.load_pqc_providers()` to auto-detect and load common
  PQC providers (oqsprovider, liboqs, oqs, oqs-provider)
- Auto-load common PQC providers on module initialization (best-effort)
- Support both old OQS names (DILITHIUM2, KYBER768, etc.) and
  standardized NIST names (ML-DSA-44, ML-KEM-768, SLH-DSA-SHA2-*, etc.)
- Add comprehensive LDoc documentation for all new functions
- Add test suite covering query, load, and combined scenarios

This completes Phase 2.4 of the PQC implementation roadmap.
Pull Request #408: Feat/pqc

913 of 1124 new or added lines in 10 files covered. (81.23%)

45 existing lines in 10 files now uncovered.

9519 of 10434 relevant lines covered (91.23%)

1598.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.13
/src/pkey/engine.c
1
/***
2
 * pkey engine module
3
 * Engine support for hardware acceleration
4
 */
5
#include "pkey.h"
6

7
/* Suppress deprecation warnings */
8
#if defined(__GNUC__) || defined(__clang__)
9
#pragma GCC diagnostic push
10
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
11
#endif
12

13
#ifndef OPENSSL_NO_ENGINE
14

15
/***
16
 * set engine for the key
17
 * @function set_engine
18
 * @tparam openssl.engine eng engine object to use for this key
19
 * @treturn boolean result true for success
20
 */
21
int
22
openssl_pkey_set_engine(lua_State *L)
8✔
23
{
24
  EVP_PKEY *pkey = CHECK_OBJECT(1, EVP_PKEY, "openssl.evp_pkey");
8✔
25
  ENGINE   *eng = CHECK_OBJECT(2, ENGINE, "openssl.engine");
8✔
26

27
  int ret = 0;
8✔
28

29
  int typ = EVP_PKEY_type(EVP_PKEY_id(pkey));
8✔
30
  switch (typ) {
8✔
31
#ifndef OPENSSL_NO_RSA
32
  case EVP_PKEY_RSA: {
4✔
33
    RSA              *rsa = (RSA *)EVP_PKEY_get0_RSA(pkey);
4✔
34
    const RSA_METHOD *m = ENGINE_get_RSA(eng);
4✔
35
    if (m != NULL) ret = RSA_set_method(rsa, m);
4✔
36
    break;
4✔
37
  }
38
#endif
39
#ifndef OPENSSL_NO_DSA
40
  case EVP_PKEY_DSA: {
2✔
41
    DSA              *dsa = (DSA *)EVP_PKEY_get0_DSA(pkey);
2✔
42
    const DSA_METHOD *m = ENGINE_get_DSA(eng);
2✔
43
    if (m != NULL) ret = DSA_set_method(dsa, m);
2✔
44
    break;
2✔
45
  }
46
#endif
47
#ifndef OPENSSL_NO_DH
NEW
48
  case EVP_PKEY_DH: {
×
NEW
49
    DH              *dh = (DH *)EVP_PKEY_get0_DH(pkey);
×
NEW
50
    const DH_METHOD *m = ENGINE_get_DH(eng);
×
NEW
51
    if (m != NULL) ret = DH_set_method(dh, m);
×
NEW
52
    break;
×
53
  }
54
#endif
55
#ifndef OPENSSL_NO_EC
56
  case EVP_PKEY_EC: {
2✔
57
    EC_KEY *ec = (EC_KEY *)EVP_PKEY_get0_EC_KEY(pkey);
2✔
58
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
59
    const ECDSA_METHOD *m = ENGINE_get_ECDSA(eng);
1✔
60
    if (m != NULL) ret = ECDSA_set_method(ec, m);
1✔
61
#else
62
    const EC_KEY_METHOD *m = ENGINE_get_EC(eng);
1✔
63
    if (m != NULL) ret = EC_KEY_set_method(ec, m);
1✔
64
#endif
65
    break;
2✔
66
  }
67
#endif
NEW
68
  default:
×
NEW
69
    break;
×
70
  }
71

72
  lua_pushboolean(L, ret == 1);
8✔
73
  return 1;
8✔
74
}
75
#endif /* OPENSSL_NO_ENGINE */
76

77
#if defined(__GNUC__) || defined(__clang__)
78
#pragma GCC diagnostic pop
79
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc