~ubuntu-branches/ubuntu/utopic/dropbear/utopic-proposed

« back to all changes in this revision

Viewing changes to libtomcrypt/testprof/dsa_test.c

  • Committer: Bazaar Package Importer
  • Author(s): Gerrit Pape, Matt Johnston, Gerrit Pape
  • Date: 2008-03-27 20:08:06 UTC
  • mfrom: (1.4.1 upstream) (9 hardy)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20080327200806-c1hhdgt3ht2gk496
Tags: 0.51-1
[ Matt Johnston ]
* New upstream release.
  - Wait until a process exits before the server closes a connection,
    so that an exit code can be sent. This fixes problems with exit
    codes not being returned, which could cause scp to fail (closes:
    #448397, #472483).

[ Gerrit Pape ]
* debian/dropbear.postinst: don't print an error message if the
  update-service program is not installed (thx Matt).

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
int dsa_test(void)
6
6
{
7
7
   unsigned char msg[16], out[1024], out2[1024];
8
 
   unsigned long x;
 
8
   unsigned long x, y;
9
9
   int stat1, stat2;
10
10
   dsa_key key, key2;
11
11
 
15
15
   /* verify it */
16
16
   DO(dsa_verify_key(&key, &stat1));
17
17
   if (stat1 == 0) { fprintf(stderr, "dsa_verify_key "); return 1; }
 
18
   
 
19
   /* encrypt a message */
 
20
   for (x = 0; x < 16; x++) { msg[x] = x; }
 
21
   x = sizeof(out);
 
22
   DO(dsa_encrypt_key(msg, 16, out, &x, &yarrow_prng, find_prng("yarrow"), find_hash("sha1"), &key));
 
23
   
 
24
   /* decrypt */
 
25
   y = sizeof(out2);
 
26
   DO(dsa_decrypt_key(out, x, out2, &y, &key));
 
27
   
 
28
   if (y != 16 || memcmp(out2, msg, 16)) {
 
29
      fprintf(stderr, "dsa_decrypt failed, y == %lu\n", y);
 
30
      return 1;
 
31
   }
18
32
 
19
33
   /* sign the message */
20
34
   x = sizeof(out);
64
78
#endif
65
79
 
66
80
/* $Source: /cvs/libtom/libtomcrypt/testprof/dsa_test.c,v $ */
67
 
/* $Revision: 1.8 $ */
68
 
/* $Date: 2005/06/03 19:24:32 $ */
 
81
/* $Revision: 1.9 $ */
 
82
/* $Date: 2005/10/30 18:49:14 $ */