* Update the encryption key */
| 888 | * Update the encryption key |
| 889 | */ |
| 890 | static void |
| 891 | ng_mppc_updatekey(u_int32_t bits, |
| 892 | u_char *key0, u_char *key, struct rc4_state *rc4) |
| 893 | { |
| 894 | const int keylen = KEYLEN(bits); |
| 895 | |
| 896 | ng_mppc_getkey(key0, key, keylen); |
| 897 | rc4_init(rc4, key, keylen); |
| 898 | rc4_crypt(rc4, key, key, keylen); |
| 899 | if ((bits & MPPE_40) != 0) |
| 900 | bcopy(&ng_mppe_weakenkey, key, 3); |
| 901 | else if ((bits & MPPE_56) != 0) |
| 902 | bcopy(&ng_mppe_weakenkey, key, 1); |
| 903 | rc4_init(rc4, key, keylen); |
| 904 | } |
| 905 | #endif |
no test coverage detected