Skip to content

Commit

Permalink
Fix finishcert function
Browse files Browse the repository at this point in the history
The cert start must be at offset 0
  • Loading branch information
mlschroe committed Sep 6, 2019
1 parent a948a13 commit 46eb664
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,11 @@ x509_tbscert(struct x509 *cb, const char *cn, const char *email, time_t start, t
void
x509_finishcert(struct x509 *cb, byte *sig, int sigl)
{
int offset = cb->len;
x509_add_const(cb, sig_algo_rsa_sha256);
x509_add(cb, 0, 1);
x509_add(cb, sig, sigl);
x509_tag(cb, cb->len - (sigl + 1), 0x03);
x509_tag(cb, offset, 0x30);
x509_tag(cb, 0, 0x30);
}

byte *
Expand Down

0 comments on commit 46eb664

Please sign in to comment.