Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
12582bf7
Commit
12582bf7
authored
Sep 11, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: RSA support
parent
2fee22a9
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
193 additions
and
64 deletions
+193
-64
src/misc/update.h
src/misc/update.h
+25
-12
src/misc/update_crypto.c
src/misc/update_crypto.c
+168
-52
No files found.
src/misc/update.h
View file @
12582bf7
...
@@ -52,12 +52,21 @@ struct public_key_packet_t
...
@@ -52,12 +52,21 @@ struct public_key_packet_t
uint8_t
version
;
/* we use only version 4 */
uint8_t
version
;
/* we use only version 4 */
uint8_t
timestamp
[
4
];
/* creation time of the key */
uint8_t
timestamp
[
4
];
/* creation time of the key */
uint8_t
algo
;
/* we only use DSA */
uint8_t
algo
;
/* DSA or RSA */
/* the multi precision integers, with their 2 bytes length header */
/* the multi precision integers, with their 2 bytes length header */
uint8_t
p
[
2
+
3072
/
8
];
union
{
uint8_t
q
[
2
+
256
/
8
];
struct
{
uint8_t
g
[
2
+
3072
/
8
];
uint8_t
p
[
2
+
3072
/
8
];
uint8_t
y
[
2
+
3072
/
8
];
uint8_t
q
[
2
+
256
/
8
];
uint8_t
g
[
2
+
3072
/
8
];
uint8_t
y
[
2
+
3072
/
8
];
}
dsa
;
struct
{
uint8_t
n
[
2
+
4096
/
8
];
uint8_t
e
[
2
+
4096
/
8
];
}
rsa
;
}
sig
;
};
};
/* used for public key and file signatures */
/* used for public key and file signatures */
...
@@ -66,7 +75,7 @@ struct signature_packet_t
...
@@ -66,7 +75,7 @@ struct signature_packet_t
uint8_t
version
;
/* 3 or 4 */
uint8_t
version
;
/* 3 or 4 */
uint8_t
type
;
uint8_t
type
;
uint8_t
public_key_algo
;
/* DSA o
nly
*/
uint8_t
public_key_algo
;
/* DSA o
r RSA
*/
uint8_t
digest_algo
;
uint8_t
digest_algo
;
uint8_t
hash_verification
[
2
];
uint8_t
hash_verification
[
2
];
...
@@ -90,12 +99,16 @@ struct signature_packet_t
...
@@ -90,12 +99,16 @@ struct signature_packet_t
/* The part below is made of consecutive MPIs, their number and size being
/* The part below is made of consecutive MPIs, their number and size being
* public-key-algorithm dependent.
* public-key-algorithm dependent.
*
* Since we use DSA signatures only, there is 2 integers, r & s.
* They range from 160 for 1k keys to 256 bits for 3k keys.
*/
*/
uint8_t
r
[
2
+
256
/
8
];
union
{
uint8_t
s
[
2
+
256
/
8
];
struct
{
uint8_t
r
[
2
+
256
/
8
];
uint8_t
s
[
2
+
256
/
8
];
}
dsa
;
struct
{
uint8_t
s
[
2
+
4096
/
8
];
}
rsa
;
}
algo_specific
;
};
};
typedef
struct
public_key_packet_t
public_key_packet_t
;
typedef
struct
public_key_packet_t
public_key_packet_t
;
...
@@ -171,7 +184,7 @@ parse_public_key(
...
@@ -171,7 +184,7 @@ parse_public_key(
const
uint8_t
*
p_sig_issuer
);
const
uint8_t
*
p_sig_issuer
);
/*
/*
* Verify an OpenPGP signature made on some hash, with some
DSA
public key
* Verify an OpenPGP signature made on some hash, with some public key
*/
*/
int
int
verify_signature
(
signature_packet_t
*
sign
,
public_key_packet_t
*
p_key
,
verify_signature
(
signature_packet_t
*
sign
,
public_key_packet_t
*
p_key
,
...
...
src/misc/update_crypto.c
View file @
12582bf7
This diff is collapsed.
Click to expand it.
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