~ubuntu-branches/ubuntu/quantal/util-linux/quantal

« back to all changes in this revision

Viewing changes to lib/md5.c

  • Committer: Package Import Robot
  • Author(s): Steve Langasek
  • Date: 2011-12-16 22:53:42 UTC
  • mfrom: (1.6.4) (4.5.5 sid)
  • Revision ID: package-import@ubuntu.com-20111216225342-206wz4bhvutyvx0d
Tags: 2.20.1-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Build for multiarch.
  - Add pre-depends on multiarch-support.
  - configure.ac: don't try to be clever about extracting a path name from
    $libdir to append to /usr in a way that's not overridable; instead,
    reuse the built-in configurable libexecdir.
  - Fix up the .pc.in files to know about libexecdir, so our substitutions
    don't leave us with unusable pkg-config files.
  - Install custom blkid.conf to use /dev/.blkid.tab since we don't
    expect device names to survive a reboot
  - Mention mountall(8) in fstab(5) manpages, along with its special
    options.
  - Since upstart is required in Ubuntu, the hwclock.sh init script is not
    called on startup and the hwclockfirst.sh init script is removed.
  - Drop depends on initscripts for the above.
  - Replace hwclock udev rule with an Upstart job.
  - For the case where mount is called with a directory to mount, look
    that directory up in mountall's /lib/init/fstab if we couldn't find
    it mentioned anywhere else.  This means "mount /proc", "mount /sys",
    etc. work.
  - mount.8 points to the cifs-utils package, not the obsolete smbfs one. 
  - Use canonicalize_spec in getmntdevbackward. proc should not be
    interpreted as a non-canonical-path.
* Dropped changes, superseded upstream:
  - shlibs/mount/src/tab_update.c: don't refuse to update mtab when source
    is 'none'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
 * Final wrapup - pad to 64-byte boundary with the bit pattern 
108
108
 * 1 0* (64-bit count of bits processed, MSB-first)
109
109
 */
110
 
void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
 
110
void MD5Final(unsigned char digest[MD5LENGTH], struct MD5Context *ctx)
111
111
{
112
112
    unsigned count;
113
113
    unsigned char *p;
144
144
 
145
145
    MD5Transform(ctx->buf, (uint32_t *) ctx->in);
146
146
    byteReverse((unsigned char *) ctx->buf, 4);
147
 
    memcpy(digest, ctx->buf, 16);
 
147
    memcpy(digest, ctx->buf, MD5LENGTH);
148
148
    memset(ctx, 0, sizeof(*ctx));       /* In case it's sensitive */
149
149
}
150
150