|
87 | 87 | recursive = flag.Bool("r", false, "should it open the directory recursively")
|
88 | 88 | tarball = flag.Bool("t", false, "is it a tar archive")
|
89 | 89 | format = flag.String("f", "json", "certificate file format [json, crt, der]")
|
90 |
| - pull = flag.Bool("p", true, "pull from redis?") |
| 90 | + pull = flag.Bool("p", false, "pull from redis?") |
91 | 91 | cr redis.Conn
|
92 | 92 | )
|
93 | 93 |
|
@@ -380,8 +380,8 @@ func insertLeafCertificate(fp string, c certMapElm) error {
|
380 | 380 | }
|
381 | 381 | }
|
382 | 382 | J:
|
383 |
| - // q := `INSERT INTO "certificate" (hash, "is_CA", "is_SS", issuer, subject, cert_chain, is_valid_chain, file_path) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) ON CONFLICT DO NOTHING` |
384 |
| - q := `INSERT INTO "certificate" (hash, "is_CA", "is_SS", issuer, subject, cert_chain, is_valid_chain, file_path) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) ON CONFLICT (hash) DO UPDATE SET file_path = excluded.file_path` |
| 383 | + // q := `INSERT INTO "certificate" (hash, "is_CA", "is_SS", issuer, subject, cert_chain, is_valid_chain, atrest_path) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) ON CONFLICT DO NOTHING` |
| 384 | + q := `INSERT INTO "certificate" (hash, "is_CA", "is_SS", issuer, subject, cert_chain, is_valid_chain, atrest_path) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) ON CONFLICT (hash) DO UPDATE SET atrest_path = excluded.atrest_path` |
385 | 385 | _, err = db.Exec(q, c.CertHash, c.Certificate.IsCA, false, c.Certificate.Issuer.String(), c.Certificate.Subject.String(), nil, false, fp)
|
386 | 386 | fmt.Println(fp)
|
387 | 387 | if err != nil {
|
@@ -624,7 +624,7 @@ func unique(s []certMapElm) []certMapElm {
|
624 | 624 | }
|
625 | 625 |
|
626 | 626 | func insertCertificate(fp string, c certMapElm) (string, error) {
|
627 |
| - q := `INSERT INTO "certificate" (hash, "is_CA", "is_SS", issuer, subject, cert_chain, is_valid_chain, file_path) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) ON CONFLICT DO NOTHING` |
| 627 | + q := `INSERT INTO "certificate" (hash, "is_CA", "is_SS", issuer, subject, cert_chain, is_valid_chain, atrest_path) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) ON CONFLICT DO NOTHING` |
628 | 628 | _, err := db.Exec(q, c.CertHash, c.Certificate.IsCA, c.chain.isSS, c.Certificate.Issuer.String(), c.Certificate.Subject.String(), c.chain.s, c.chain.isValid, getFullPath(fp, c.CertHash))
|
629 | 629 | if err != nil {
|
630 | 630 | return c.CertHash, err
|
|
0 commit comments