set version on the selfsigned cert

This commit is contained in:
Klas Lindfors
2014-06-25 14:14:23 +02:00
parent 58e078af2f
commit 1ded0f6496
+4
View File
@@ -676,6 +676,10 @@ static bool selfsign_certificate(ykpiv_state *state, enum enum_key_format key_fo
fprintf(stderr, "Failed to allocate certificate structure.\n"); fprintf(stderr, "Failed to allocate certificate structure.\n");
goto selfsign_out; goto selfsign_out;
} }
if(!X509_set_version(x509, 2)) {
fprintf(stderr, "Failed to set certificate version.\n");
goto selfsign_out;
}
if(!X509_set_pubkey(x509, public_key)) { if(!X509_set_pubkey(x509, public_key)) {
fprintf(stderr, "Failed to set the certificate public key.\n"); fprintf(stderr, "Failed to set the certificate public key.\n");
goto selfsign_out; goto selfsign_out;