Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dmitry Baryshkov
nettle
Commits
2a65d90b
Commit
2a65d90b
authored
8 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Use const char * for sexp expression types.
parent
ef97526d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
ChangeLog
+4
-0
4 additions, 0 deletions
ChangeLog
sexp.c
+4
-4
4 additions, 4 deletions
sexp.c
sexp.h
+4
-4
4 additions, 4 deletions
sexp.h
sexp2dsa.c
+2
-2
2 additions, 2 deletions
sexp2dsa.c
sexp2rsa.c
+2
-2
2 additions, 2 deletions
sexp2rsa.c
with
16 additions
and
12 deletions
ChangeLog
+
4
−
0
View file @
2a65d90b
2016-08-16 Niels Möller <nisse@lysator.liu.se>
* sexp.c (sexp_iterator_check_type, sexp_iterator_check_types)
(sexp_iterator_assoc): Use const char * for caller's expression
types. Updated all callers.
* rsa2openpgp.c (rsa_keypair_to_openpgp): Added cast to const
uint8_t *.
...
...
This diff is collapsed.
Click to expand it.
sexp.c
+
4
−
4
View file @
2a65d90b
...
...
@@ -295,7 +295,7 @@ sexp_iterator_get_uint32(struct sexp_iterator *iterator,
int
sexp_iterator_check_type
(
struct
sexp_iterator
*
iterator
,
const
uint8_t
*
type
)
const
char
*
type
)
{
return
(
sexp_iterator_enter_list
(
iterator
)
&&
iterator
->
type
==
SEXP_ATOM
...
...
@@ -305,10 +305,10 @@ sexp_iterator_check_type(struct sexp_iterator *iterator,
&&
sexp_iterator_next
(
iterator
));
}
const
uint8_t
*
const
char
*
sexp_iterator_check_types
(
struct
sexp_iterator
*
iterator
,
unsigned
ntypes
,
const
uint8_t
*
const
*
types
)
const
char
*
const
*
types
)
{
if
(
sexp_iterator_enter_list
(
iterator
)
&&
iterator
->
type
==
SEXP_ATOM
...
...
@@ -327,7 +327,7 @@ sexp_iterator_check_types(struct sexp_iterator *iterator,
int
sexp_iterator_assoc
(
struct
sexp_iterator
*
iterator
,
unsigned
nkeys
,
const
uint8_t
*
const
*
keys
,
const
char
*
const
*
keys
,
struct
sexp_iterator
*
values
)
{
TMP_DECL
(
found
,
int
,
NETTLE_MAX_SEXP_ASSOC
);
...
...
This diff is collapsed.
Click to expand it.
sexp.h
+
4
−
4
View file @
2a65d90b
...
...
@@ -130,12 +130,12 @@ sexp_iterator_get_uint32(struct sexp_iterator *iterator,
*/
int
sexp_iterator_check_type
(
struct
sexp_iterator
*
iterator
,
const
uint8_t
*
type
);
const
char
*
type
);
const
uint8_t
*
const
char
*
sexp_iterator_check_types
(
struct
sexp_iterator
*
iterator
,
unsigned
ntypes
,
const
uint8_t
*
const
*
types
);
const
char
*
const
*
types
);
/* Current element must be a list. Looks up element of type
*
...
...
@@ -149,7 +149,7 @@ sexp_iterator_check_types(struct sexp_iterator *iterator,
int
sexp_iterator_assoc
(
struct
sexp_iterator
*
iterator
,
unsigned
nkeys
,
const
uint8_t
*
const
*
keys
,
const
char
*
const
*
keys
,
struct
sexp_iterator
*
values
);
...
...
This diff is collapsed.
Click to expand it.
sexp2dsa.c
+
2
−
2
View file @
2a65d90b
...
...
@@ -61,7 +61,7 @@ dsa_keypair_from_sexp_alist(struct dsa_params *params,
unsigned
q_bits
,
struct
sexp_iterator
*
i
)
{
static
const
uint8_t
*
const
names
[
5
]
static
const
char
*
const
names
[
5
]
=
{
"p"
,
"q"
,
"g"
,
"y"
,
"x"
};
struct
sexp_iterator
values
[
5
];
unsigned
nvalues
=
priv
?
5
:
4
;
...
...
@@ -131,7 +131,7 @@ dsa_signature_from_sexp(struct dsa_signature *rs,
struct
sexp_iterator
*
i
,
unsigned
q_bits
)
{
static
const
uint8_t
*
const
names
[
2
]
=
{
"r"
,
"s"
};
static
const
char
*
const
names
[
2
]
=
{
"r"
,
"s"
};
struct
sexp_iterator
values
[
2
];
if
(
!
sexp_iterator_assoc
(
i
,
2
,
names
,
values
))
...
...
This diff is collapsed.
Click to expand it.
sexp2rsa.c
+
2
−
2
View file @
2a65d90b
...
...
@@ -59,7 +59,7 @@ rsa_keypair_from_sexp_alist(struct rsa_public_key *pub,
unsigned
limit
,
struct
sexp_iterator
*
i
)
{
static
const
uint8_t
*
const
names
[
8
]
static
const
char
*
const
names
[
8
]
=
{
"n"
,
"e"
,
"d"
,
"p"
,
"q"
,
"a"
,
"b"
,
"c"
};
struct
sexp_iterator
values
[
8
];
unsigned
nvalues
=
priv
?
8
:
2
;
...
...
@@ -99,7 +99,7 @@ rsa_keypair_from_sexp(struct rsa_public_key *pub,
size_t
length
,
const
uint8_t
*
expr
)
{
struct
sexp_iterator
i
;
static
const
uint8_t
*
const
names
[
3
]
static
const
char
*
const
names
[
3
]
=
{
"rsa"
,
"rsa-pkcs1"
,
"rsa-pkcs1-sha1"
};
if
(
!
sexp_iterator_first
(
&
i
,
length
,
expr
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment