static void add_key(EVP_PKEY * key, EVP_PKEY *** keys, int *nkeys) {
	EVP_PKEY **keys2;
	/* sanity checks */
	if (!key) return;
	if (!keys) return;
	if (!nkeys) return;
	/* no keys so far */
	if (!*keys) {
		*keys = malloc(sizeof(void *));
		if (!*keys) return;
		*keys[0] = key;
		*nkeys = 1;
		return;
	}
	/* enlarge */
	keys2 = malloc(sizeof(void *) * ((*nkeys) + 1));
	if (!keys2) return;
	memcpy(keys2, *keys, sizeof(void *) * (*nkeys));
	keys2[*nkeys] = key;
	free(*keys);
	*keys = keys2;
	(*nkeys)++;
}
static void add_key(EVP_PKEY * key, EVP_PKEY *** keys, int *nkeys) {
	EVP_PKEY **keys2;
	 
	if (!key) return;
	if (!keys) return;
	if (!nkeys) return;
	 
	if (!*keys) {
		*keys = malloc(sizeof(void *));
		if (!*keys) return;
		*keys[0] = key;
		*nkeys = 1;
		return;
	}
	 
	keys2 = malloc(sizeof(void *) * ((*nkeys) + 1));
	if (!keys2) return;
	memcpy(keys2, *keys, sizeof(void *) * (*nkeys));
	keys2[*nkeys] = key;
	free(*keys);
	*keys = keys2;
	(*nkeys)++;
}