* security API interface */
| 2681 | * security API interface |
| 2682 | */ |
| 2683 | SR_PRIV int dsl_secuCheck(const struct sr_dev_inst *sdi, uint16_t* encryption, int steps) |
| 2684 | { |
| 2685 | int tryCnt = SECU_TRY_CNT; |
| 2686 | |
| 2687 | dsl_secuReset(sdi); |
| 2688 | if (dsl_isSecuPass(sdi)) |
| 2689 | return SR_ERR; |
| 2690 | dsl_secuWrite(sdi, SECU_START, 0); |
| 2691 | while(steps--) { |
| 2692 | if (dsl_isSecuPass(sdi)) |
| 2693 | return SR_ERR; |
| 2694 | while(!dsl_isSecuReady(sdi)) { |
| 2695 | if (tryCnt-- == 0) { |
| 2696 | sr_err("Get security ready failed."); |
| 2697 | return SR_ERR; |
| 2698 | } |
| 2699 | } |
| 2700 | if (dsl_secuRead(sdi) != 0) |
| 2701 | return SR_ERR; |
| 2702 | dsl_secuWrite(sdi, SECU_CHECK, encryption[steps]); |
| 2703 | } |
| 2704 | |
| 2705 | return SR_OK; |
| 2706 | } |
no test coverage detected