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

« back to all changes in this revision

Viewing changes to genrsa.c

  • Committer: Bazaar Package Importer
  • Author(s): Matt Johnston
  • Date: 2005-12-08 19:20:21 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051208192021-nyp9rwnt77nsg6ty
Tags: 0.47-1
* New upstream release.
* SECURITY: Fix incorrect buffer sizing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
                genrandom(buf, size+1);
109
109
                buf[0] |= 0x80; /* MSB set */
110
110
 
111
 
                if (mp_read_unsigned_bin(prime, buf, size+1) != MP_OKAY) {
112
 
                        fprintf(stderr, "rsa generation failed\n");
113
 
                        exit(1);
114
 
                }
 
111
                bytes_to_mp(prime, buf, size+1);
115
112
 
116
113
                /* find the next integer which is prime, 8 round of miller-rabin */
117
114
                if (mp_prime_next_prime(prime, 8, 0) != MP_OKAY) {