| 169 | } |
| 170 | |
| 171 | srtp_err_status_t srtp_crypto_kernel_status(void) |
| 172 | { |
| 173 | srtp_err_status_t status; |
| 174 | srtp_kernel_cipher_type_t *ctype = crypto_kernel.cipher_type_list; |
| 175 | srtp_kernel_auth_type_t *atype = crypto_kernel.auth_type_list; |
| 176 | |
| 177 | /* for each cipher type, describe and test */ |
| 178 | while (ctype != NULL) { |
| 179 | srtp_err_report(srtp_err_level_info, "cipher: %s\n", |
| 180 | ctype->cipher_type->description); |
| 181 | srtp_err_report(srtp_err_level_info, " self-test: "); |
| 182 | status = srtp_cipher_type_self_test(ctype->cipher_type); |
| 183 | if (status) { |
| 184 | srtp_err_report(srtp_err_level_error, "failed with error code %d\n", |
| 185 | status); |
| 186 | exit(status); |
| 187 | } |
| 188 | srtp_err_report(srtp_err_level_info, "passed\n"); |
| 189 | ctype = ctype->next; |
| 190 | } |
| 191 | |
| 192 | /* for each auth type, describe and test */ |
| 193 | while (atype != NULL) { |
| 194 | srtp_err_report(srtp_err_level_info, "auth func: %s\n", |
| 195 | atype->auth_type->description); |
| 196 | srtp_err_report(srtp_err_level_info, " self-test: "); |
| 197 | status = srtp_auth_type_self_test(atype->auth_type); |
| 198 | if (status) { |
| 199 | srtp_err_report(srtp_err_level_error, "failed with error code %d\n", |
| 200 | status); |
| 201 | exit(status); |
| 202 | } |
| 203 | srtp_err_report(srtp_err_level_info, "passed\n"); |
| 204 | atype = atype->next; |
| 205 | } |
| 206 | |
| 207 | srtp_crypto_kernel_list_debug_modules(); |
| 208 | |
| 209 | return srtp_err_status_ok; |
| 210 | } |
| 211 | |
| 212 | srtp_err_status_t srtp_crypto_kernel_list_debug_modules(void) |
| 213 | { |