File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,8 @@ func NewNTDSCaSecurityExt(sid string) (ext pkix.Extension, err error) {
5353 return ext , nil
5454}
5555
56- // SID retrieves the SID from the szOID_NTDS_CA_SECURITY_EXT extension of the
57- // certificate if it is present and returns an error otherwise .
56+ // SID retrieves the SID from the szOID_NTDS_CA_SECURITY_EXT extension and an
57+ // empty string with no error when the extension is not present .
5858func SID (cert * x509.Certificate ) (string , error ) {
5959 for _ , extension := range append (cert .Extensions , cert .ExtraExtensions ... ) {
6060 if ! extension .Id .Equal (NTDSCASecurityExtOID ) {
@@ -64,7 +64,7 @@ func SID(cert *x509.Certificate) (string, error) {
6464 return SIDFromExtension (extension )
6565 }
6666
67- return "" , fmt . Errorf ( "certificate has no NTDS_CA_SECURITY_EXT extension" )
67+ return "" , nil
6868}
6969
7070// SID retrieves the SID from the szOID_NTDS_CA_SECURITY_EXT extension.
You can’t perform that action at this time.
0 commit comments