sss_ssh.c revision 347f7c4d1e8e83fc7ffcaf9524a67e8b3ad5d7c5
/*
Authors:
Jan Cholasta <jcholast@redhat.com>
Copyright (C) 2012 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <talloc.h>
#include <popt.h>
#include <locale.h>
#include <libintl.h>
#include "config.h"
#include "util/crypto/sss_crypto.h"
#include "sss_client/sss_cli.h"
#include "sss_client/ssh/sss_ssh.h"
/* FIXME - split from tools_util to create a common function */
{
}
/* FIXME - split from tools_util to create a common function */
int set_locale(void)
{
char *c;
if (c == NULL) {
return EIO;
}
errno = 0;
if (c == NULL) {
return errno;
}
errno = 0;
c = textdomain(PACKAGE);
if (c == NULL) {
return errno;
}
return EOK;
}
enum sss_cli_command command,
const char *name,
struct sss_ssh_pubkey **pubkeys,
{
size_t c = 0;
struct sss_cli_req_data rd;
if (!tmp_ctx) {
return ENOMEM;
}
/* build request */
if (!req) {
goto done;
}
SAFEALIGN_SET_UINT32(req+c, 0, &c);
/* send request */
if (req_ret != SSS_STATUS_SUCCESS) {
goto done;
}
goto done;
}
/* parse reply */
c = 0;
goto done;
}
if (reserved != 0) {
goto done;
}
if (count > 0) {
if (!result) {
goto done;
}
}
for (i = 0; i < count; i++) {
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
}
*pubkeys_len = count;
done:
return ret;
}
char *
struct sss_ssh_pubkey *pubkey)
{
size_t c = 0;
char *algo;
if (!algo) {
return NULL;
}
return algo;
}
struct sss_ssh_pubkey *pubkey,
enum sss_ssh_pubkey_format format,
char **result)
{
char *pk;
char *algo;
char *out;
if (!pubkey) {
return EINVAL;
}
if (!tmp_ctx) {
return ENOMEM;
}
if (!pk) {
goto done;
}
switch (format) {
case SSS_SSH_FORMAT_RAW:
/* base64-encoded key blob */
break;
case SSS_SSH_FORMAT_OPENSSH:
/* OpenSSH authorized_keys/known_hosts format */
if (!algo) {
goto done;
}
if (!out) {
goto done;
}
break;
}
done:
return ret;
}