[Swan-commit] Changes to ref refs/heads/master
D. Hugh Redelmeier
hugh at vault.libreswan.fi
Mon Jan 21 15:28:02 UTC 2019
Author: D. Hugh Redelmeier <hugh at mimosa.com>
Date: Mon Jan 21 10:14:06 2019 -0500
Pluto: a little bit of weeding
- reduce heap use
+ Hashes fit in a buffer of modest and bounded size. If the
lifetime of the buffer suits stack allocation, use auto.
This reduces code complexity and the real chance of leaks.
ikev2_verify_ecdsa_hash (a leak eliminated)
+ replace create_unified_ppk_id with emit_unified_ppk_id
so no heap-allocated chunk is required. Simpler too.
- delay heap use
+ move chunk cloning to caller of rfc_resource_record_to_rsa_pubkey
+ unsure of unpack_ECDSA_public_key so added ??? comment
- use bool-valued expression in boolean contexts (don't use pointers
or ints; result of bitwise operator OK)
- reduce scope of autos; don't reuse autos
- add a couple of ??? comments
- in a function definition, if the argument list is too long for one
line, put each argument on its own line.
- sprinkle const
- in ikev2_ecdsa.c: sporadic use of FALSE and TRUE replaced by false
- use size_t for sizes, even though previous unsigned int would work:
this makes it clearer that variable is about sizes.
More information about the Swan-commit