~ubuntu-branches/ubuntu/quantal/aria2/quantal

« back to all changes in this revision

Viewing changes to src/LibgcryptDHKeyExchange.h

  • Committer: Bazaar Package Importer
  • Author(s): Kartik Mistry
  • Date: 2010-11-24 12:26:31 UTC
  • mfrom: (1.6.1 upstream) (2.3.8 experimental)
  • Revision ID: james.westby@ubuntu.com-20101124122631-upujekj1ek94h3x2
Tags: 1.10.6-1
* New upstream release:
  + Fixed FTBFS on alpha arch (Closes: #590257)
  + Added IPv6 support (Closes: #448390)
* debian/patches/ftbfs_kfreebsd.diff:
  + Dropped, merged upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 * files in the program, then also delete it here.
33
33
 */
34
34
/* copyright --> */
35
 
#ifndef _D_LIBGCRYPT_DH_KEY_EXCHANGE_H_
36
 
#define _D_LIBGCRYPT_DH_KEY_EXCHANGE_H_
 
35
#ifndef D_LIBGCRYPT_DH_KEY_EXCHANGE_H
 
36
#define D_LIBGCRYPT_DH_KEY_EXCHANGE_H
37
37
 
38
38
#include "common.h"
39
39
#include "DlAbortEx.h"
113
113
  {
114
114
    if(outLength < keyLength_) {
115
115
      throw DL_ABORT_EX
116
 
        (StringFormat("Insufficient buffer for public key. expect:%u, actual:%u",
117
 
                      keyLength_, outLength).str());
 
116
        (StringFormat
 
117
         ("Insufficient buffer for public key. expect:%lu, actual:%lu",
 
118
          static_cast<unsigned long>(keyLength_),
 
119
          static_cast<unsigned long>(outLength)).str());
118
120
    }
119
121
    memset(out, 0, outLength);
120
122
    size_t publicKeyBytes = (gcry_mpi_get_nbits(publicKey_)+7)/8;
139
141
  {
140
142
    if(outLength < keyLength_) {
141
143
      throw DL_ABORT_EX
142
 
        (StringFormat("Insufficient buffer for secret. expect:%u, actual:%u",
143
 
                      keyLength_, outLength).str());
 
144
        (StringFormat("Insufficient buffer for secret. expect:%lu, actual:%lu",
 
145
                      static_cast<unsigned long>(keyLength_),
 
146
                      static_cast<unsigned long>(outLength)).str());
144
147
    }
145
148
    gcry_mpi_t peerPublicKey;
146
149
    {
172
175
 
173
176
} // namespace aria2
174
177
 
175
 
#endif // _D_LIBGCRYPT_DH_KEY_EXCHANGE_H_
 
178
#endif // D_LIBGCRYPT_DH_KEY_EXCHANGE_H