+static int check_key_file(const char *file, int private)
+{
+ struct stat st;
+
+ if (stat(file, &st) != 0)
+ return -ERRNO_TO_PARA_ERROR(errno);
+ if (private != LOAD_PRIVATE_KEY)
+ return 0;
+ if ((st.st_uid == getuid()) && (st.st_mode & 077) != 0)
+ return -E_KEY_PERM;
+ return 1;
+}
+