|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Security.Checks.weakCryptographicKey</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Security.Checks.weakCryptographicKey</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing checks for weak cryptographic key use. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 <tr><td>None</td></tr> |
|
23 </table> |
|
24 <h3>Functions</h3> |
|
25 |
|
26 <table> |
|
27 |
|
28 <tr> |
|
29 <td><a href="#_classifyKeySize">_classifyKeySize</a></td> |
|
30 <td>Function to classify a key and report an error if insufficient.</td> |
|
31 </tr> |
|
32 <tr> |
|
33 <td><a href="#_weakCryptoKeySizeCryptography">_weakCryptoKeySizeCryptography</a></td> |
|
34 <td>Function to check 'cryptography.hazmat' for weak key use.</td> |
|
35 </tr> |
|
36 <tr> |
|
37 <td><a href="#_weakCryptoKeySizePycrypto">_weakCryptoKeySizePycrypto</a></td> |
|
38 <td>Function to check 'pycrypto' for weak key use.</td> |
|
39 </tr> |
|
40 <tr> |
|
41 <td><a href="#checkWeakCryptographicKey">checkWeakCryptographicKey</a></td> |
|
42 <td>Function to check for weak cryptographic key use.</td> |
|
43 </tr> |
|
44 <tr> |
|
45 <td><a href="#getChecks">getChecks</a></td> |
|
46 <td>Public method to get a dictionary with checks handled by this module.</td> |
|
47 </tr> |
|
48 </table> |
|
49 <hr /> |
|
50 <hr /> |
|
51 <a NAME="_classifyKeySize" ID="_classifyKeySize"></a> |
|
52 <h2>_classifyKeySize</h2> |
|
53 <b>_classifyKeySize</b>(<i>reportError, config, keyType, keySize, node</i>) |
|
54 |
|
55 <p> |
|
56 Function to classify a key and report an error if insufficient. |
|
57 </p> |
|
58 <dl> |
|
59 |
|
60 <dt><i>reportError</i> (func)</dt> |
|
61 <dd> |
|
62 function to be used to report errors |
|
63 </dd> |
|
64 <dt><i>config</i> (dict)</dt> |
|
65 <dd> |
|
66 dictionary with configuration data |
|
67 </dd> |
|
68 <dt><i>keyType</i> (str)</dt> |
|
69 <dd> |
|
70 type of key to be classified ('DSA', 'RSA', 'EC') |
|
71 </dd> |
|
72 <dt><i>keySize</i> (int)</dt> |
|
73 <dd> |
|
74 size of the key to be classified |
|
75 </dd> |
|
76 <dt><i>node</i> (ast.Call)</dt> |
|
77 <dd> |
|
78 node the key was extracted from (needed for reporting) |
|
79 </dd> |
|
80 </dl> |
|
81 <dl> |
|
82 <dt>Return:</dt> |
|
83 <dd> |
|
84 flag indicating an error was reported |
|
85 </dd> |
|
86 </dl> |
|
87 <dl> |
|
88 <dt>Return Type:</dt> |
|
89 <dd> |
|
90 bool |
|
91 </dd> |
|
92 </dl> |
|
93 <div align="right"><a href="#top">Up</a></div> |
|
94 <hr /> |
|
95 <hr /> |
|
96 <a NAME="_weakCryptoKeySizeCryptography" ID="_weakCryptoKeySizeCryptography"></a> |
|
97 <h2>_weakCryptoKeySizeCryptography</h2> |
|
98 <b>_weakCryptoKeySizeCryptography</b>(<i>reportError, context, config</i>) |
|
99 |
|
100 <p> |
|
101 Function to check 'cryptography.hazmat' for weak key use. |
|
102 </p> |
|
103 <dl> |
|
104 |
|
105 <dt><i>reportError</i> (func)</dt> |
|
106 <dd> |
|
107 function to be used to report errors |
|
108 </dd> |
|
109 <dt><i>context</i> (SecurityContext)</dt> |
|
110 <dd> |
|
111 security context object |
|
112 </dd> |
|
113 <dt><i>config</i> (dict)</dt> |
|
114 <dd> |
|
115 dictionary with configuration data |
|
116 </dd> |
|
117 </dl> |
|
118 <dl> |
|
119 <dt>Return:</dt> |
|
120 <dd> |
|
121 flag indicating an error was reported |
|
122 </dd> |
|
123 </dl> |
|
124 <dl> |
|
125 <dt>Return Type:</dt> |
|
126 <dd> |
|
127 bool |
|
128 </dd> |
|
129 </dl> |
|
130 <div align="right"><a href="#top">Up</a></div> |
|
131 <hr /> |
|
132 <hr /> |
|
133 <a NAME="_weakCryptoKeySizePycrypto" ID="_weakCryptoKeySizePycrypto"></a> |
|
134 <h2>_weakCryptoKeySizePycrypto</h2> |
|
135 <b>_weakCryptoKeySizePycrypto</b>(<i>reportError, context, config</i>) |
|
136 |
|
137 <p> |
|
138 Function to check 'pycrypto' for weak key use. |
|
139 </p> |
|
140 <dl> |
|
141 |
|
142 <dt><i>reportError</i> (func)</dt> |
|
143 <dd> |
|
144 function to be used to report errors |
|
145 </dd> |
|
146 <dt><i>context</i> (SecurityContext)</dt> |
|
147 <dd> |
|
148 security context object |
|
149 </dd> |
|
150 <dt><i>config</i> (dict)</dt> |
|
151 <dd> |
|
152 dictionary with configuration data |
|
153 </dd> |
|
154 </dl> |
|
155 <dl> |
|
156 <dt>Return:</dt> |
|
157 <dd> |
|
158 flag indicating an error was reported |
|
159 </dd> |
|
160 </dl> |
|
161 <dl> |
|
162 <dt>Return Type:</dt> |
|
163 <dd> |
|
164 bool |
|
165 </dd> |
|
166 </dl> |
|
167 <div align="right"><a href="#top">Up</a></div> |
|
168 <hr /> |
|
169 <hr /> |
|
170 <a NAME="checkWeakCryptographicKey" ID="checkWeakCryptographicKey"></a> |
|
171 <h2>checkWeakCryptographicKey</h2> |
|
172 <b>checkWeakCryptographicKey</b>(<i>reportError, context, config</i>) |
|
173 |
|
174 <p> |
|
175 Function to check for weak cryptographic key use. |
|
176 </p> |
|
177 <dl> |
|
178 |
|
179 <dt><i>reportError</i> (func)</dt> |
|
180 <dd> |
|
181 function to be used to report errors |
|
182 </dd> |
|
183 <dt><i>context</i> (SecurityContext)</dt> |
|
184 <dd> |
|
185 security context object |
|
186 </dd> |
|
187 <dt><i>config</i> (dict)</dt> |
|
188 <dd> |
|
189 dictionary with configuration data |
|
190 </dd> |
|
191 </dl> |
|
192 <div align="right"><a href="#top">Up</a></div> |
|
193 <hr /> |
|
194 <hr /> |
|
195 <a NAME="getChecks" ID="getChecks"></a> |
|
196 <h2>getChecks</h2> |
|
197 <b>getChecks</b>(<i></i>) |
|
198 |
|
199 <p> |
|
200 Public method to get a dictionary with checks handled by this module. |
|
201 </p> |
|
202 <dl> |
|
203 <dt>Return:</dt> |
|
204 <dd> |
|
205 dictionary containing checker lists containing checker function and |
|
206 list of codes |
|
207 </dd> |
|
208 </dl> |
|
209 <dl> |
|
210 <dt>Return Type:</dt> |
|
211 <dd> |
|
212 dict |
|
213 </dd> |
|
214 </dl> |
|
215 <div align="right"><a href="#top">Up</a></div> |
|
216 <hr /> |
|
217 </body></html> |