Roxen.git / server / etc / modules / CertDB.pmod

version» Context lines:

Roxen.git/server/etc/modules/CertDB.pmod:246:    " FROM cert_keys "    " WHERE keyhash = %s",    key_info->keyhash);    if (!sizeof(tmp)) {    db->query("INSERT INTO cert_keys "    " (pem_id, msg_no, keyhash, data) "    "VALUES (%d, %d, %s, %s)",    key_info->pem_id, key_info->msg_no,    key_info->keyhash, key_info->data);    key_info->id = db->master_sql->insert_id(); +  SSL3_WERR("Added cert key #%d.\n", key_info->id);       // Check if we have any matching certificates that currently lack keys,    // and add corresponding keypairs.    foreach(db->typed_query("SELECT * "    " FROM certs "    " WHERE keyhash = %s "    " ORDER BY id ASC",    key_info->keyhash),    sql_row cert_info) {    if (sizeof(db->query("SELECT * "
Roxen.git/server/etc/modules/CertDB.pmod:275:    } else {    name += " " + format_dn(cert_info->issuer);    }    db->query("INSERT INTO cert_keypairs "    " (cert_id, key_id, name) "    "VALUES (%d, %d, %s)",    cert_info->id, key_info->id, name);    }    } else {    // Zap any stale or update in progress marker for the key. +  if (tmp[0]->data != key_info->data) { +  // The encrypted data string has changed; this may be due +  // to the server salt having been changed, or due to the +  // old value having been created with an old proken Pike. +  SSL3_WERR("Updating cert key #%d. Has the server salt changed?\n", +  tmp[0]->id);    db->query("UPDATE cert_keys "    " SET pem_id = %d, " -  +  " msg_no = %d, " +  " data = %s " +  " WHERE id = %d", +  key_info->pem_id, key_info->msg_no, key_info->data, +  tmp[0]->id); +  } else { +  db->query("UPDATE cert_keys " +  " SET pem_id = %d, "    " msg_no = %d "    " WHERE id = %d",    key_info->pem_id, key_info->msg_no,    tmp[0]->id);    }    } -  +  }       foreach(certs, sql_row cert_info) {    tmp = db->typed_query("SELECT * "    " FROM certs "    " WHERE keyhash = %s "    " AND subject = %s "    " AND issuer = %s",    cert_info->keyhash,    cert_info->subject,    cert_info->issuer);