Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nettle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
5
Merge Requests
5
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Nettle
nettle
Commits
cc57adbb
Commit
cc57adbb
authored
Sep 13, 2018
by
Niels Möller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'attribute-deprecated'
parents
1aedf851
f7e49547
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
79 additions
and
44 deletions
+79
-44
ChangeLog
ChangeLog
+16
-0
aes-set-decrypt-key.c
aes-set-decrypt-key.c
+3
-0
aes.h
aes.h
+10
-6
ecc-curve.h
ecc-curve.h
+7
-13
gcm-aes.c
gcm-aes.c
+3
-0
gcm.h
gcm.h
+10
-7
nettle-meta.h
nettle-meta.h
+4
-16
nettle-types.h
nettle-types.h
+17
-0
rsa-internal.h
rsa-internal.h
+3
-2
testsuite/aes-test.c
testsuite/aes-test.c
+3
-0
testsuite/gcm-test.c
testsuite/gcm-test.c
+3
-0
No files found.
ChangeLog
View file @
cc57adbb
2018-08-09 Niels Möller <nisse@lysator.liu.se>
* rsa-internal.h (_rsa_blind, _rsa_unblind): Mark with
_NETTLE_ATTRIBUTE_DEPRECATED.
* nettle-types.h (_NETTLE_ATTRIBUTE_PURE)
(_NETTLE_ATTRIBUTE_DEPRECATED): New macros, for gcc and
lookalikes.
* ecc-curve.h: Include nettle-types.h, and use
_NETTLE_ATTRIBUTE_PURE instead of local definition.
* nettle-meta.h: Use _NETTLE_ATTRIBUTE_PURE, instead of explicit
#ifdefs.
* aes.h: Mark functions using struct aes_ctx interface as
deprecated. Add #undef _NETTLE_ATTRIBUTE_DEPRECATED in files where
the functions are implemented or tested.
* gcm.h: Similarly mark functions using gcm_aes_ctx as deprecated.
* nettle-internal.c (des_set_key_wrapper, des3_set_key_wrapper)
(blowfish128_set_key_wrapper): Wrapper functions, to avoid cast
between incompatible function types (which gcc-8 warns about).
...
...
aes-set-decrypt-key.c
View file @
cc57adbb
...
...
@@ -36,6 +36,9 @@
# include "config.h"
#endif
/* This file implements and uses deprecated functions */
#define _NETTLE_ATTRIBUTE_DEPRECATED
#include "aes-internal.h"
void
...
...
aes.h
View file @
cc57adbb
...
...
@@ -76,7 +76,8 @@ extern "C" {
#define AES_MIN_KEY_SIZE AES128_KEY_SIZE
#define AES_MAX_KEY_SIZE AES256_KEY_SIZE
/* Older nettle-2.7 interface */
/* The older nettle-2.7 AES interface is deprecated, please migrate to
the newer interface where each algorithm has a fixed key size. */
#define AES_KEY_SIZE 32
...
...
@@ -88,24 +89,27 @@ struct aes_ctx
void
aes_set_encrypt_key
(
struct
aes_ctx
*
ctx
,
size_t
length
,
const
uint8_t
*
key
);
size_t
length
,
const
uint8_t
*
key
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
void
aes_set_decrypt_key
(
struct
aes_ctx
*
ctx
,
size_t
length
,
const
uint8_t
*
key
);
size_t
length
,
const
uint8_t
*
key
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
void
aes_invert_key
(
struct
aes_ctx
*
dst
,
const
struct
aes_ctx
*
src
);
const
struct
aes_ctx
*
src
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
void
aes_encrypt
(
const
struct
aes_ctx
*
ctx
,
size_t
length
,
uint8_t
*
dst
,
const
uint8_t
*
src
);
const
uint8_t
*
src
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
void
aes_decrypt
(
const
struct
aes_ctx
*
ctx
,
size_t
length
,
uint8_t
*
dst
,
const
uint8_t
*
src
);
const
uint8_t
*
src
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
struct
aes128_ctx
{
...
...
ecc-curve.h
View file @
cc57adbb
...
...
@@ -34,6 +34,8 @@
#ifndef NETTLE_ECC_CURVE_H_INCLUDED
#define NETTLE_ECC_CURVE_H_INCLUDED
#include "nettle-types.h"
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
@@ -41,19 +43,11 @@ extern "C" {
/* The contents of this struct is internal. */
struct
ecc_curve
;
#ifdef __GNUC__
#define NETTLE_PURE __attribute__((pure))
#else
#define NETTLE_PURE
#endif
const
struct
ecc_curve
*
NETTLE_PURE
nettle_get_secp_192r1
(
void
);
const
struct
ecc_curve
*
NETTLE_PURE
nettle_get_secp_224r1
(
void
);
const
struct
ecc_curve
*
NETTLE_PURE
nettle_get_secp_256r1
(
void
);
const
struct
ecc_curve
*
NETTLE_PURE
nettle_get_secp_384r1
(
void
);
const
struct
ecc_curve
*
NETTLE_PURE
nettle_get_secp_521r1
(
void
);
#undef NETTLE_PURE
const
struct
ecc_curve
*
_NETTLE_ATTRIBUTE_PURE
nettle_get_secp_192r1
(
void
);
const
struct
ecc_curve
*
_NETTLE_ATTRIBUTE_PURE
nettle_get_secp_224r1
(
void
);
const
struct
ecc_curve
*
_NETTLE_ATTRIBUTE_PURE
nettle_get_secp_256r1
(
void
);
const
struct
ecc_curve
*
_NETTLE_ATTRIBUTE_PURE
nettle_get_secp_384r1
(
void
);
const
struct
ecc_curve
*
_NETTLE_ATTRIBUTE_PURE
nettle_get_secp_521r1
(
void
);
#ifdef __cplusplus
}
...
...
gcm-aes.c
View file @
cc57adbb
...
...
@@ -35,6 +35,9 @@
# include "config.h"
#endif
/* This file implements and uses deprecated functions */
#define _NETTLE_ATTRIBUTE_DEPRECATED
#include "gcm.h"
void
...
...
gcm.h
View file @
cc57adbb
...
...
@@ -261,31 +261,34 @@ void
gcm_aes256_digest
(
struct
gcm_aes256_ctx
*
ctx
,
size_t
length
,
uint8_t
*
digest
);
/* Old aes interface, for backwards compatibility */
/* Old
deprecated
aes interface, for backwards compatibility */
struct
gcm_aes_ctx
GCM_CTX
(
struct
aes_ctx
);
void
gcm_aes_set_key
(
struct
gcm_aes_ctx
*
ctx
,
size_t
length
,
const
uint8_t
*
key
);
size_t
length
,
const
uint8_t
*
key
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
void
gcm_aes_set_iv
(
struct
gcm_aes_ctx
*
ctx
,
size_t
length
,
const
uint8_t
*
iv
);
size_t
length
,
const
uint8_t
*
iv
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
void
gcm_aes_update
(
struct
gcm_aes_ctx
*
ctx
,
size_t
length
,
const
uint8_t
*
data
);
size_t
length
,
const
uint8_t
*
data
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
void
gcm_aes_encrypt
(
struct
gcm_aes_ctx
*
ctx
,
size_t
length
,
uint8_t
*
dst
,
const
uint8_t
*
src
);
size_t
length
,
uint8_t
*
dst
,
const
uint8_t
*
src
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
void
gcm_aes_decrypt
(
struct
gcm_aes_ctx
*
ctx
,
size_t
length
,
uint8_t
*
dst
,
const
uint8_t
*
src
);
size_t
length
,
uint8_t
*
dst
,
const
uint8_t
*
src
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
void
gcm_aes_digest
(
struct
gcm_aes_ctx
*
ctx
,
size_t
length
,
uint8_t
*
digest
);
gcm_aes_digest
(
struct
gcm_aes_ctx
*
ctx
,
size_t
length
,
uint8_t
*
digest
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
struct
gcm_camellia128_ctx
GCM_CTX
(
struct
camellia128_ctx
);
...
...
nettle-meta.h
View file @
cc57adbb
...
...
@@ -61,10 +61,7 @@ struct nettle_cipher
};
/* null-terminated list of ciphers implemented by this version of nettle */
const
struct
nettle_cipher
*
const
*
#ifdef __GNUC__
__attribute__
((
pure
))
#endif
const
struct
nettle_cipher
*
const
*
_NETTLE_ATTRIBUTE_PURE
nettle_get_ciphers
(
void
);
#define nettle_ciphers (nettle_get_ciphers())
...
...
@@ -121,10 +118,7 @@ struct nettle_hash
}
/* null-terminated list of digests implemented by this version of nettle */
const
struct
nettle_hash
*
const
*
#ifdef __GNUC__
__attribute__
((
pure
))
#endif
const
struct
nettle_hash
*
const
*
_NETTLE_ATTRIBUTE_PURE
nettle_get_hashes
(
void
);
#define nettle_hashes (nettle_get_hashes())
...
...
@@ -172,10 +166,7 @@ struct nettle_aead
/* null-terminated list of aead constructions implemented by this
version of nettle */
const
struct
nettle_aead
*
const
*
#ifdef __GNUC__
__attribute__
((
pure
))
#endif
const
struct
nettle_aead
*
const
*
_NETTLE_ATTRIBUTE_PURE
nettle_get_aeads
(
void
);
#define nettle_aeads (nettle_get_aeads())
...
...
@@ -238,10 +229,7 @@ struct nettle_armor
}
/* null-terminated list of armor schemes implemented by this version of nettle */
const
struct
nettle_armor
*
const
*
#ifdef __GNUC__
__attribute__
((
pure
))
#endif
const
struct
nettle_armor
*
const
*
_NETTLE_ATTRIBUTE_PURE
nettle_get_armors
(
void
);
#define nettle_armors (nettle_get_armors())
...
...
nettle-types.h
View file @
cc57adbb
...
...
@@ -39,6 +39,23 @@
#define _STDINT_HAVE_INT_FAST32_T 1
#include "nettle-stdint.h"
/* Attributes we want to use in installed header files, and hence
can't rely on config.h. */
#ifdef __GNUC__
#define _NETTLE_ATTRIBUTE_PURE __attribute__((pure))
#ifndef _NETTLE_ATTRIBUTE_DEPRECATED
/* Variant without message is supported since gcc-3.1 or so. */
#define _NETTLE_ATTRIBUTE_DEPRECATED __attribute__((deprecated))
#endif
#else
/* !__GNUC__ */
#define _NETTLE_ATTRIBUTE_PURE
#define _NETTLE_ATTRIBUTE_DEPRECATED
#endif
/* !__GNUC__ */
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
rsa-internal.h
View file @
cc57adbb
...
...
@@ -61,8 +61,9 @@ _rsa_check_size(mpz_t n);
void
_rsa_blind
(
const
struct
rsa_public_key
*
pub
,
void
*
random_ctx
,
nettle_random_func
*
random
,
mpz_t
c
,
mpz_t
ri
);
mpz_t
c
,
mpz_t
ri
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
void
_rsa_unblind
(
const
struct
rsa_public_key
*
pub
,
mpz_t
c
,
const
mpz_t
ri
);
_rsa_unblind
(
const
struct
rsa_public_key
*
pub
,
mpz_t
c
,
const
mpz_t
ri
)
_NETTLE_ATTRIBUTE_DEPRECATED
;
#endif
/* NETTLE_RSA_INTERNAL_H_INCLUDED */
testsuite/aes-test.c
View file @
cc57adbb
/* This file tests deprecated functions */
#define _NETTLE_ATTRIBUTE_DEPRECATED
#include "testutils.h"
#include "aes.h"
#include "nettle-internal.h"
...
...
testsuite/gcm-test.c
View file @
cc57adbb
/* This file tests deprecated functions */
#define _NETTLE_ATTRIBUTE_DEPRECATED
#include "testutils.h"
#include "nettle-internal.h"
#include "gcm.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment