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
24
Issue boards
Milestones
Wiki
Code
Merge requests
5
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
Commits
b2454450
Commit
b2454450
authored
5 years ago
by
Damyan Mitev
Browse files
Options
Downloads
Patches
Plain Diff
fix certificate serial number generation (again)
parent
052c6212
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!71
[VCL] Sign generated v-card upon using a profile
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
javascript/src/utilities/signingUtilities.js
+5
-0
5 additions, 0 deletions
javascript/src/utilities/signingUtilities.js
with
5 additions
and
0 deletions
javascript/src/utilities/signingUtilities.js
+
5
−
0
View file @
b2454450
...
...
@@ -435,6 +435,11 @@ function createCertificate(certData, issuerData = null) {
const
serialNumberView
=
new
Uint8Array
(
serialNumberBuffer
);
pkijs
.
getRandomValues
(
serialNumberView
);
serialNumberView
[
0
]
&=
0x7f
;
while
(
serialNumberView
[
0
]
===
0
&&
(
serialNumberView
[
1
]
&
0x80
)
===
0
)
{
const
firstBytesView
=
new
Uint8Array
(
serialNumberBuffer
,
0
,
2
);
pkijs
.
getRandomValues
(
firstBytesView
);
firstBytesView
[
0
]
&=
0x7f
;
}
// noinspection JSUnresolvedFunction
certificate
.
serialNumber
=
new
asn1js
.
Integer
({
valueHex
:
serialNumberView
...
...
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