MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ng_mppc_updatekey

Function ng_mppc_updatekey

freebsd/netgraph/ng_mppc.c:890–904  ·  view source on GitHub ↗

* Update the encryption key */

Source from the content-addressed store, hash-verified

888 * Update the encryption key
889 */
890static void
891ng_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

Callers 2

ng_mppc_compressFunction · 0.85
ng_mppc_decompressFunction · 0.85

Calls 3

ng_mppc_getkeyFunction · 0.85
rc4_initFunction · 0.85
rc4_cryptFunction · 0.85

Tested by

no test coverage detected