pike.git / lib / modules / Sql.pmod / pgsql.pike

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql.pike:716:    if(sizeof(f))    msgresponse[f[..0]]=f[1..];    PD("%O\n",msgresponse);    return msgresponse;    };    case 'R': {    void authresponse(array msg) {    object cs = ci->start();    CHAIN(cs)->add_int8('p')->add_hstring(msg, 4, 4);    cs->sendcmd(SENDOUT); // No flushing, PostgreSQL 9.4 disapproves -  } +  };    PD("Authentication ");    msglen-=4+4;    int authtype, k;    switch(authtype = cr->read_int32()) {    case 0:    PD("Ok\n");    if (cnonce) {    PD("Authentication validation still in progress\n");    errtype = PROTOCOLUNSUPPORTED;    } else {
pike.git/lib/modules/Sql.pmod/pgsql.pike:795:    case "SCRAM-SHA-256":    k = 1;    }   #ifdef PG_DEBUG    msglen -= sizeof(word) + 1;    if (msglen < 1)    break;   #endif    }    if (k) { -  cnonce = MIME.encode_base64(Random.System().random_string(18)); +  cnonce = MIME.encode_base64(random_string(18));    word = "n,,n=,r=" + cnonce;    authresponse(({    "SCRAM-SHA-256", 0, sprintf("%4c", sizeof(word)), word    }));    } else    errtype = PROTOCOLUNSUPPORTED;   #ifdef PG_DEBUG    if(msglen != 1)    errtype=PROTOCOLERROR;    msglen=0;