version 1.66, 2006/03/25 13:17:01 |
version 1.67, 2006/04/25 08:02:27 |
|
|
|
|
Key * |
Key * |
key_load_private_type(int type, const char *filename, const char *passphrase, |
key_load_private_type(int type, const char *filename, const char *passphrase, |
char **commentp) |
char **commentp, int *perm_ok) |
{ |
{ |
int fd; |
int fd; |
|
|
|
|
if (fd < 0) |
if (fd < 0) |
return NULL; |
return NULL; |
if (!key_perm_ok(fd, filename)) { |
if (!key_perm_ok(fd, filename)) { |
|
if (perm_ok != NULL) |
|
*perm_ok = 0; |
error("bad permissions: ignore key: %s", filename); |
error("bad permissions: ignore key: %s", filename); |
close(fd); |
close(fd); |
return NULL; |
return NULL; |
} |
} |
|
if (perm_ok != NULL) |
|
*perm_ok = 1; |
switch (type) { |
switch (type) { |
case KEY_RSA1: |
case KEY_RSA1: |
return key_load_private_rsa1(fd, filename, passphrase, |
return key_load_private_rsa1(fd, filename, passphrase, |