src/ssl.c

changeset 8
fbaccf44ea01
parent 7
da3cf40976f6
child 9
bb7e0d7a0a08
equal deleted inserted replaced
7:da3cf40976f6 8:fbaccf44ea01
390 { 390 {
391 X509_NAME *subject; 391 X509_NAME *subject;
392 int i, n_entries, len; 392 int i, n_entries, len;
393 char buffer[4096]; 393 char buffer[4096];
394 394
395 lua_newtable(L); 395 lua_newtable(L); /* ret */
396 396
397 lua_pushboolean(L, (SSL_get_verify_result(ssl->ssl) == X509_V_OK)); 397 lua_pushboolean(L, (SSL_get_verify_result(ssl->ssl) == X509_V_OK));
398 lua_setfield(L, -2, "trusted"); 398 lua_setfield(L, -2, "trusted");
399 399
400 subject = X509_get_subject_name(peer); 400 subject = X509_get_subject_name(peer);
401 401
402 n_entries = X509_NAME_entry_count(subject); 402 n_entries = X509_NAME_entry_count(subject);
403 403
404 lua_newtable(L); /* ret */
405 lua_newtable(L); /* {} */ 404 lua_newtable(L); /* {} */
406 lua_pushvalue(L, -1); 405 lua_pushvalue(L, -1);
407 lua_setfield(L, -3, "subject"); /* ret.subject = {} */ 406 lua_setfield(L, -3, "subject"); /* ret.subject = {} */
408 for(i = 0; i <= n_entries; i++) 407 for(i = 0; i <= n_entries; i++)
409 { 408 {

mercurial