~ubuntu-branches/ubuntu/lucid/9base/lucid

« back to all changes in this revision

Viewing changes to lib9/netcrypt.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-08-20 17:34:06 UTC
  • mfrom: (6.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090820173406-xpwqa9ruyevvc0ut
Tags: 1:3-3
* Updating maintainer field.
* Updating vcs fields.
* Updating package to standards version 3.8.3.
* Updatin variables writing in rules to consistent style.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <u.h>
 
2
#include <libc.h>
 
3
#include <auth.h>
 
4
 
 
5
int
 
6
netcrypt(void *key, void *chal)
 
7
{
 
8
        uchar buf[8], *p;
 
9
 
 
10
        strncpy((char*)buf, chal, 7);
 
11
        buf[7] = '\0';
 
12
        for(p = buf; *p && *p != '\n'; p++)
 
13
                ;
 
14
        *p = '\0';
 
15
        encrypt(key, buf, 8);
 
16
        sprint(chal, "%.2ux%.2ux%.2ux%.2ux", buf[0], buf[1], buf[2], buf[3]);
 
17
        return 1;
 
18
}