]> andersk Git - openssh.git/blobdiff - auth-skey.c
- deraadt@cvs.openbsd.org 2006/08/03 03:34:42
[openssh.git] / auth-skey.c
index f676dbec9594e30c48e63f63d829582b3f4a530d..d49e59b75954d2c0ad356395f21da09126c425e7 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenBSD: auth-skey.c,v 1.24 2006/08/03 03:34:41 deraadt Exp $ */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 #include "includes.h"
-RCSID("$OpenBSD: auth-skey.c,v 1.20 2002/06/30 21:59:45 deraadt Exp $");
 
 #ifdef SKEY
 
+#include <sys/types.h>
+
 #include <skey.h>
 
 #include "xmalloc.h"
@@ -54,15 +57,10 @@ skey_query(void *ctx, char **name, char **infotxt,
        *name  = xstrdup("");
        *infotxt  = xstrdup("");
        *numprompts = 1;
-       *prompts = xmalloc(*numprompts * sizeof(char *));
-       *echo_on = xmalloc(*numprompts * sizeof(u_int));
-       (*echo_on)[0] = 0;
-
-       len = strlen(challenge) + strlen(SKEY_PROMPT) + 1;
-       p = xmalloc(len);
-       strlcpy(p, challenge, len);
-       strlcat(p, SKEY_PROMPT, len);
-       (*prompts)[0] = p;
+       *prompts = xcalloc(*numprompts, sizeof(char *));
+       *echo_on = xcalloc(*numprompts, sizeof(u_int));
+
+       xasprintf(*prompts, "%s%s", challenge, SKEY_PROMPT);
 
        return 0;
 }
This page took 0.043191 seconds and 4 git commands to generate.