~ubuntu-branches/ubuntu/vivid/gnupg/vivid

« back to all changes in this revision

Viewing changes to cipher/md.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-12-04 22:26:16 UTC
  • mfrom: (1.1.18 sid)
  • Revision ID: package-import@ubuntu.com-20121204222616-cr0fow26geq90l3y
Tags: 1.4.12-6ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Disable mlock() test since it fails with ulimit 0 (on buildds).
  - Set gpg (or gpg2) and gpgsm to use a passphrase agent by default.
  - Only suggest gnupg-curl and libldap; recommendations are pulled into
    minimal, and we don't need the keyserver utilities in a minimal Ubuntu
    system.
  - Remove the Win32 build.
  - Update config.guess/config.sub for aarch64.
* Dropped patches:
  - Fix udeb build failure on powerpc, building with -O2 instead of -Os.
    (No longer seems to be necessary.)
* Simplify removal of Win32 build, to make this easier to merge in future.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
  r->name = (*get_info)( algo, &r->contextsize,
66
66
                         &r->asnoid, &r->asnlen, &r->mdlen,
67
67
                         &r->init, &r->write, &r->final, &r->read );
68
 
  if (!r->name ) 
 
68
  if (!r->name )
69
69
    {
70
70
      xfree(r);
71
71
      r = NULL;
82
82
 
83
83
/*
84
84
  Load all available hash algorithms and return true.  Subsequent
85
 
  calls will return 0.  
 
85
  calls will return 0.
86
86
 */
87
87
static int
88
88
load_digest_module (void)
96
96
  /* We load them in reverse order so that the most
97
97
     frequently used are the first in the list. */
98
98
#ifdef USE_SHA512
99
 
  if (!new_list_item (DIGEST_ALGO_SHA512, sha512_get_info)) 
 
99
  if (!new_list_item (DIGEST_ALGO_SHA512, sha512_get_info))
100
100
    BUG ();
101
 
  if (!new_list_item (DIGEST_ALGO_SHA384, sha384_get_info)) 
 
101
  if (!new_list_item (DIGEST_ALGO_SHA384, sha384_get_info))
102
102
    BUG ();
103
103
#endif
104
104
#ifdef USE_SHA256
105
 
  if (!new_list_item (DIGEST_ALGO_SHA256, sha256_get_info)) 
 
105
  if (!new_list_item (DIGEST_ALGO_SHA256, sha256_get_info))
106
106
    BUG ();
107
 
  if (!new_list_item (DIGEST_ALGO_SHA224, sha224_get_info)) 
 
107
  if (!new_list_item (DIGEST_ALGO_SHA224, sha224_get_info))
108
108
    BUG ();
109
109
#endif
110
 
  if (!new_list_item (DIGEST_ALGO_MD5, md5_get_info)) 
111
 
    BUG ();
112
 
  if (!new_list_item (DIGEST_ALGO_RMD160, rmd160_get_info)) 
113
 
    BUG ();
114
 
  if (!new_list_item (DIGEST_ALGO_SHA1, sha1_get_info)) 
 
110
  if (!new_list_item (DIGEST_ALGO_MD5, md5_get_info))
 
111
    BUG ();
 
112
  if (!new_list_item (DIGEST_ALGO_RMD160, rmd160_get_info))
 
113
    BUG ();
 
114
  if (!new_list_item (DIGEST_ALGO_SHA1, sha1_get_info))
115
115
    BUG ();
116
116
 
117
117
  return 1;
118
 
}      
 
118
}
119
119
 
120
120
 
121
121
/****************
317
317
    }
318
318
    for(r=a->list; r; r = r->next ) {
319
319
        (*r->write)( &r->context.c, a->buffer, a->bufcount );
320
 
        /* Fixme: all ->write fnc should take a const byte* */ 
 
320
        /* Fixme: all ->write fnc should take a const byte* */
321
321
        (*r->write)( &r->context.c, (byte*)inbuf, inlen );
322
322
    }
323
323
    a->bufcount = 0;
508
508
        log_debug("md debug: can't open %s\n", buf );
509
509
}
510
510
 
 
511
 
511
512
void
512
513
md_stop_debug( MD_HANDLE md )
513
514
{
519
520
    }
520
521
#ifdef HAVE_U64_TYPEDEF
521
522
    {  /* a kludge to pull in the __muldi3 for Solaris */
 
523
#if GNUPG_GCC_VERSION >= 40600
 
524
# pragma GCC diagnostic ignored "-Wunused-but-set-variable"
 
525
#endif
522
526
       volatile u32 a = (u32)(ulong)md;
523
527
       volatile u64 b = 42;
524
528
       volatile u64 c;