|
Lines 2046-2051
load_public_identity_files(void)
Link Here
|
| 2046 |
Key *identity_keys[SSH_MAX_IDENTITY_FILES]; |
2046 |
Key *identity_keys[SSH_MAX_IDENTITY_FILES]; |
| 2047 |
char *certificate_files[SSH_MAX_CERTIFICATE_FILES]; |
2047 |
char *certificate_files[SSH_MAX_CERTIFICATE_FILES]; |
| 2048 |
struct sshkey *certificates[SSH_MAX_CERTIFICATE_FILES]; |
2048 |
struct sshkey *certificates[SSH_MAX_CERTIFICATE_FILES]; |
|
|
2049 |
size_t filename_len; |
| 2050 |
struct stat sb; |
| 2049 |
#ifdef ENABLE_PKCS11 |
2051 |
#ifdef ENABLE_PKCS11 |
| 2050 |
Key **keys; |
2052 |
Key **keys; |
| 2051 |
int nkeys; |
2053 |
int nkeys; |
|
Lines 2162-2167
load_public_identity_files(void)
Link Here
|
| 2162 |
certificate_files[n_certs] = filename; |
2164 |
certificate_files[n_certs] = filename; |
| 2163 |
certificates[n_certs] = public; |
2165 |
certificates[n_certs] = public; |
| 2164 |
++n_certs; |
2166 |
++n_certs; |
|
|
2167 |
|
| 2168 |
/* |
| 2169 |
* If no keys have been explicitly listed then try |
| 2170 |
* to add the default private key variant too. |
| 2171 |
*/ |
| 2172 |
if (options.num_identity_files != 0) |
| 2173 |
continue; |
| 2174 |
if (n_ids >= SSH_MAX_IDENTITY_FILES) |
| 2175 |
continue; |
| 2176 |
filename_len = strlen(filename); |
| 2177 |
if (filename_len > 9 && strncmp("-cert.pub", filename + (filename_len - 9), 9) == 0) { |
| 2178 |
xasprintf(&cp, "%.*s", (int)(filename_len - 9), filename); |
| 2179 |
if (stat(cp, &sb) == 0) { /* file exists */ |
| 2180 |
debug("identity file %s type %d", cp, -1); |
| 2181 |
identity_files[n_ids] = cp; |
| 2182 |
identity_keys[n_ids] = NULL; /* since it's a private key, we'll load lazily */ |
| 2183 |
n_ids++; |
| 2184 |
} else { |
| 2185 |
free(cp); |
| 2186 |
} |
| 2187 |
} |
| 2188 |
|
| 2165 |
} |
2189 |
} |
| 2166 |
|
2190 |
|
| 2167 |
options.num_identity_files = n_ids; |
2191 |
options.num_identity_files = n_ids; |