mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-06 00:00:47 -04:00
pki: Don't generate negative random serial numbers in X.509 certificates
According to RFC 5280 4.1.2.2 we MUST force non-negative serial numbers.
This commit is contained in:
parent
0226ca886d
commit
e49197f15e
@ -363,6 +363,7 @@ static int issue()
|
||||
rng->destroy(rng);
|
||||
goto end;
|
||||
}
|
||||
serial.ptr[0] &= 0x7F;
|
||||
rng->destroy(rng);
|
||||
}
|
||||
|
||||
|
@ -314,6 +314,7 @@ static int self()
|
||||
rng->destroy(rng);
|
||||
goto end;
|
||||
}
|
||||
serial.ptr[0] &= 0x7F;
|
||||
rng->destroy(rng);
|
||||
}
|
||||
not_before = time(NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user