Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Vereign Client Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
Vereign Client Library
Merge requests
!98
Profile certificates
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Profile certificates
profile-certificates
into
master
Overview
2
Commits
6
Pipelines
0
Changes
3
1 unresolved thread
Hide all comments
Merged
Daniel Lyubomirov
requested to merge
profile-certificates
into
master
4 years ago
Overview
2
Commits
6
Pipelines
0
Changes
3
1 unresolved thread
Hide all comments
Expand
Includes:
profile certificate generation and server sign.
storing the profile certificates in the local crypto storage.
one-time profile certificate generation.
0
0
Merge request reports
Viewing commit
b9311b0b
Prev
Next
Show latest version
3 files
+
22
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
Verified
b9311b0b
Use crypto random generator for certificate serial numbers
· b9311b0b
Daniel Lyubomirov
authored
4 years ago
cpp/src/vereign/crypto/cert.cc
+
2
−
4
Options
@@ -2,6 +2,7 @@
#include
<vereign/crypto/bio.hh>
#include
<vereign/crypto/errors.hh>
#include
<vereign/crypto/rand.hh>
#include
<vereign/encoding/base64.hh>
#include
<openssl/x509v3.h>
@@ -333,10 +334,7 @@ static auto createCert(
// set serial number
auto
serial_number
=
cert_data
.
SerialNumber
;
if
(
serial_number
==
0
)
{
// FIXME: is using time ok ?
serial_number
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
std
::
chrono
::
system_clock
::
now
().
time_since_epoch
()
).
count
();
serial_number
=
crypto
::
RandUint64
();
}
r
=
ASN1_INTEGER_set_uint64
(
X509_get_serialNumber
(
cert
.
get
()),
serial_number
);
if
(
r
!=
1
)
{
Loading