镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

ECC pattern misses OpenSSL ECDSA_ and ECDH_ C API calls because of the word boundary #20

Open

Description

@thebenignhacker

The ECC-001 pattern in pkg/patterns/matcher.go:362 is (?i)\b(ECDSA|ECDH|ECC|...)\b. The regexp engine treats the underscore as a word character, so there is no word boundary between ECDSA and the underscore of an OpenSSL C API name, and the pattern does not match.

Reproduce: create a directory holding a file sign.c with these lines:
sig = ECDSA_do_sign(digest, dlen, eckey);
ok = ECDSA_verify(0, digest, dlen, sig, siglen, eckey);
n = ECDSA_sign(0, digest, dlen, sig, &siglen, eckey);
len = ECDH_compute_key(out, outlen, pub, eckey, NULL);
s = ECDSA_SIG_new();
and a file control.py holding sig = ECDSA.sign(digest, key). Run cryptoscan scan --format json on that directory. The output has totalFindings 1, from control.py only; the five C lines produce no finding. Same result at 1a8232d and bfb9ae1.

Expected: each of the five OpenSSL calls is reported as Elliptic Curve Cryptography (ECC-001) with quantum risk VULNERABLE, the same as ECDSA.sign.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions