Commit 8dbe67d2 authored by David Ward's avatar David Ward Committed by Stephen Hemminger

ip/xfrm: Do not print a zero-length algorithm key

Signed-off-by: default avatarDavid Ward <david.ward@ll.mit.edu>
parent 6128fdfd
...@@ -536,12 +536,14 @@ static void __xfrm_algo_print(struct xfrm_algo *algo, int type, int len, ...@@ -536,12 +536,14 @@ static void __xfrm_algo_print(struct xfrm_algo *algo, int type, int len,
goto fin; goto fin;
} }
fprintf(fp, "0x"); if (keylen > 0) {
for (i = 0; i < keylen; i ++) fprintf(fp, "0x");
fprintf(fp, "%.2x", (unsigned char)algo->alg_key[i]); for (i = 0; i < keylen; i ++)
fprintf(fp, "%.2x", (unsigned char)algo->alg_key[i]);
if (show_stats > 0) if (show_stats > 0)
fprintf(fp, " (%d bits)", algo->alg_key_len); fprintf(fp, " (%d bits)", algo->alg_key_len);
}
fin: fin:
if (newline) if (newline)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment