Skip to content

Commit a165661

Browse files
committed
Additional crypto libs
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
1 parent 3221239 commit a165661

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "chen"
22
ThisBuild / organization := "io.appthreat"
3-
ThisBuild / version := "2.0.10"
3+
ThisBuild / version := "2.0.11"
44
ThisBuild / scalaVersion := "3.4.1"
55

66
val cpgVersion = "1.0.0"

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"downloadUrl": "https://github.com/AppThreat/chen",
88
"issueTracker": "https://github.com/AppThreat/chen/issues",
99
"name": "chen",
10-
"version": "2.0.10",
10+
"version": "2.0.11",
1111
"description": "Code Hierarchy Exploration Net (chen) is an advanced exploration toolkit for your application source code and its dependency hierarchy.",
1212
"applicationCategory": "code-analysis",
1313
"keywords": [

meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set version = "2.0.10" %}
1+
{% set version = "2.0.11" %}
22

33
package:
44
name: chen

platform/frontends/x2cpg/src/main/scala/io/appthreat/x2cpg/passes/taggers/EasyTagsPass.scala

+9-4
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,20 @@ class EasyTagsPass(atom: Cpg) extends CpgPass(atom):
155155
).newTagNode("crypto-algorithm").store()(dstGraph)
156156
end if
157157
if language == Languages.PYTHON || language == Languages.PYTHONSRC then
158-
atom.identifier.typeFullName("cryptography.*").newTagNode("crypto").store()(dstGraph)
159-
atom.call.methodFullName("cryptography.*").newTagNode("crypto").store()(dstGraph)
158+
val known_crypto_libs = "(cryptography|Crypto|ecdsa|nacl).*"
159+
atom.identifier.typeFullName(known_crypto_libs).newTagNode(
160+
"crypto"
161+
).store()(dstGraph)
162+
atom.call.methodFullName(known_crypto_libs).newTagNode(
163+
"crypto"
164+
).store()(dstGraph)
160165
atom.call.methodFullName(
161-
"cryptography.*(generate|encrypt|decrypt|derive|sign|public_bytes|private_bytes|exchange).*"
166+
s"${known_crypto_libs}(generate|encrypt|decrypt|derive|sign|public_bytes|private_bytes|exchange|new|update|export_key|import_key|from_string|from_pem|to_pem).*"
162167
).newTagNode(
163168
"crypto-generate"
164169
).store()(dstGraph)
165170
atom.call.name("[A-Z0-9]+").methodFullName(
166-
"cryptography.*(primitives|serialization).*"
171+
s"${known_crypto_libs}(primitives|serialization).*"
167172
).argument.inCall.newTagNode(
168173
"crypto-algorithm"
169174
).store()(dstGraph)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "appthreat-chen"
3-
version = "2.0.10"
3+
version = "2.0.11"
44
description = "Code Hierarchy Exploration Net (chen)"
55
authors = ["Team AppThreat <cloud@appthreat.com>"]
66
license = "Apache-2.0"

0 commit comments

Comments
 (0)