summaryrefslogtreecommitdiff
path: root/src/cipher.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-05-12 21:30:22 +0000
committerChristian Pointner <equinox@anytun.org>2008-05-12 21:30:22 +0000
commitc38f0e21deb427802f4be2d4994903ae906ebbf2 (patch)
tree5d210c575fa40d58d4009b191c9ed68cb210efbc /src/cipher.cpp
parentadded do_ifconfig for bsd device (diff)
fixed build on linux
Diffstat (limited to 'src/cipher.cpp')
-rw-r--r--src/cipher.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cipher.cpp b/src/cipher.cpp
index 6a572b9..593218f 100644
--- a/src/cipher.cpp
+++ b/src/cipher.cpp
@@ -79,8 +79,8 @@ AesIcmCipher::AesIcmCipher() : cipher_(NULL)
// TODO: hardcoded keysize
gcry_error_t err = gcry_cipher_open( &cipher_, GCRY_CIPHER_AES128, GCRY_CIPHER_MODE_CTR, 0 );
if( err ) {
- char buf[NL_TEXTMAX];
- cLog.msg(Log::PRIO_CRIT) << "AesIcmCipher::AesIcmCipher: Failed to open cipher" << gpg_strerror_r(err, buf, NL_TEXTMAX);
+ char buf[STERROR_TEXT_MAX];
+ cLog.msg(Log::PRIO_CRIT) << "AesIcmCipher::AesIcmCipher: Failed to open cipher" << gpg_strerror_r(err, buf, STERROR_TEXT_MAX);
}
}
@@ -98,8 +98,8 @@ void AesIcmCipher::setKey(Buffer& key)
gcry_error_t err = gcry_cipher_setkey( cipher_, key.getBuf(), key.getLength() );
if( err ) {
- char buf[NL_TEXTMAX];
- cLog.msg(Log::PRIO_ERR) << "AesIcmCipher::setKey: Failed to set cipher key: " << gpg_strerror_r(err, buf, NL_TEXTMAX);
+ char buf[STERROR_TEXT_MAX];
+ cLog.msg(Log::PRIO_ERR) << "AesIcmCipher::setKey: Failed to set cipher key: " << gpg_strerror_r(err, buf, STERROR_TEXT_MAX);
}
}
@@ -129,8 +129,8 @@ void AesIcmCipher::calc(u_int8_t* in, u_int32_t ilen, u_int8_t* out, u_int32_t o
gcry_error_t err = gcry_cipher_reset( cipher_ );
if( err ) {
- char buf[NL_TEXTMAX];
- cLog.msg(Log::PRIO_ERR) << "AesIcmCipher: Failed to reset cipher: " << gpg_strerror_r(err, buf, NL_TEXTMAX);
+ char buf[STERROR_TEXT_MAX];
+ cLog.msg(Log::PRIO_ERR) << "AesIcmCipher: Failed to reset cipher: " << gpg_strerror_r(err, buf, STERROR_TEXT_MAX);
return;
}
@@ -159,15 +159,15 @@ void AesIcmCipher::calc(u_int8_t* in, u_int32_t ilen, u_int8_t* out, u_int32_t o
err = gcry_cipher_setctr( cipher_, ctr_buf, written ); // TODO: hardcoded size
delete[] ctr_buf;
if( err ) {
- char buf[NL_TEXTMAX];
- cLog.msg(Log::PRIO_ERR) << "AesIcmCipher: Failed to set cipher CTR: " << gpg_strerror_r(err, buf, NL_TEXTMAX);
+ char buf[STERROR_TEXT_MAX];
+ cLog.msg(Log::PRIO_ERR) << "AesIcmCipher: Failed to set cipher CTR: " << gpg_strerror_r(err, buf, STERROR_TEXT_MAX);
return;
}
err = gcry_cipher_encrypt( cipher_, out, olen, in, ilen );
if( err ) {
- char buf[NL_TEXTMAX];
- cLog.msg(Log::PRIO_ERR) << "AesIcmCipher: Failed to generate cipher bitstream: " << gpg_strerror_r(err, buf, NL_TEXTMAX);
+ char buf[STERROR_TEXT_MAX];
+ cLog.msg(Log::PRIO_ERR) << "AesIcmCipher: Failed to generate cipher bitstream: " << gpg_strerror_r(err, buf, STERROR_TEXT_MAX);
return;
}
}