MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / _gen_hit

Method _gen_hit

aura/analyzers/python/crypto.py:81–97  ·  view source on GitHub ↗
(self, context, info, key_size=None)

Source from the content-addressed store, hash-verified

79 yield self._gen_hit(context, info, key_size)
80
81 def _gen_hit(self, context, info, key_size=None):
82 hit = Detection(
83 detection_type="CryptoKeyGeneration",
84 message="Generation of cryptography key detected",
85 signature=f"crypto#gen_key#{context.signature}",
86 extra={
87 "function": context.node.cached_full_name,
88 "key_type": info["type"],
89 "key_size": key_size,
90 },
91 node=context.node,
92 )
93
94 if key_size is not None and key_size < MIN_KEY_SIZES.get(info["type"], 0):
95 hit.score = 100
96
97 return hit

Callers 2

_lib_cryptographyMethod · 0.95
_lib_cryptoMethod · 0.95

Calls 2

DetectionClass · 0.85
getMethod · 0.80

Tested by

no test coverage detected