diff options
| author | Po Lu | 2024-05-09 14:58:45 +0800 |
|---|---|---|
| committer | Po Lu | 2024-05-09 15:07:22 +0800 |
| commit | 67ab6bcdbac572a6266d7c9d15833bd2ddd049fa (patch) | |
| tree | 3469eaa3f625da33e3c5c5e0e91cc5c202552c81 /src/gnutls.c | |
| parent | 9b7dd30807ed4be9afe4f66cfa5130aa7d178989 (diff) | |
| download | emacs-67ab6bcdbac572a6266d7c9d15833bd2ddd049fa.tar.gz emacs-67ab6bcdbac572a6266d7c9d15833bd2ddd049fa.zip | |
Replace calls to intern with a constant string with DEFSYMs
* src/alloc.c (display_malloc_warning, syms_of_alloc):
* src/buffer.c (Fmake_indirect_buffer, Fbuffer_local_variables)
(Frename_buffer, Fkill_buffer, Fset_buffer_major_mode)
(Fset_buffer_multibyte, syms_of_buffer):
* src/callint.c (read_file_name, Fcall_interactively)
(syms_of_callint):
* src/callproc.c (call_process, create_temp_file)
(syms_of_callproc):
* src/charset.c (Fdefine_charset_internal, syms_of_charset):
* src/cmds.c (internal_self_insert, syms_of_cmds):
* src/coding.c (record_conversion_result)
(Fdefine_coding_system_internal, syms_of_coding):
* src/dbusbind.c (xd_signature, Fdbus_message_internal)
(syms_of_dbusbind):
* src/dispnew.c (init_faces_initial):
* src/doc.c (Fsnarf_documentation, syms_of_doc):
* src/dosfns.c (system_process_attributes, syms_of_dosfns):
* src/emacs.c (init_cmdargs, Fdump_emacs, decode_env_path)
(syms_of_emacs):
* src/eval.c (call_debugger, Fdefvaralias, syms_of_eval):
* src/fileio.c (barf_or_query_if_file_exists)
(Finsert_file_contents, auto_save_error, Fdo_auto_save)
(syms_of_fileio):
* src/filelock.c (lock_file_1, syms_of_filelock):
* src/fontset.c (fontset_from_font, syms_of_fontset):
* src/frame.c (make_frame_without_minibuffer, syms_of_frame):
* src/gnutls.c (emacs_gnutls_certificate_details)
(Fgnutls_peer_status_warning_describe, Fgnutls_peer_status)
(gnutls_verify_boot, syms_of_gnutls):
* src/gtkutil.c (style_changed_cb, find_rtl_image):
* src/image.c (imagemagick_filename_hint, gs_load)
(syms_of_image):
* src/keyboard.c (command_loop_1, read_char, timer_start_idle)
(read_char_minibuf_menu_prompt, Fsuspend_emacs)
(syms_of_keyboard):
* src/keymap.c (Fmap_keymap, Flookup_key, Fdescribe_vector)
(describe_vector, syms_of_keymap):
* src/lread.c (Fread, Fread_positioning_symbols, syms_of_lread):
* src/minibuf.c (Fabort_minibuffers, Fread_buffer)
(Fcompleting_read, syms_of_minibuf):
* src/msdos.c (XMenuActivate, run_msdos_command, syms_of_msdos):
* src/nsfns.m (Fx_display_backing_store, Fx_display_visual_class)
(Fns_hide_emacs, Fsystem_move_file_to_trash, ns_create_tip_frame)
(x_hide_tip, Fx_show_tip, syms_of_nsfns):
* src/nsfont.m (ns_spec_to_descriptor, ns_descriptor_to_entity)
(syms_of_nsfont):
* src/pdumper.c (Fdump_emacs_portable):
* src/pgtkfns.c (Fx_display_visual_class, x_create_tip_frame)
(Fx_show_tip, syms_of_pgtkfns):
* src/pgtkterm.c (syms_of_pgtkterm, pgtk_cr_export_frames):
* src/term.c (term_get_fkeys_1, set_tty_color_mode, Fsuspend_tty)
(Fresume_tty, tty_menu_activate, syms_of_term):
* src/terminal.c (create_terminal, syms_of_terminal):
* src/w32fns.c (Fx_display_backing_store)
(Fx_display_visual_class, Fset_message_beep, Fx_open_connection)
(Fx_show_tip, Fx_file_dialog, Fsystem_move_file_to_trash)
(Fw32_toggle_lock_key, syms_of_w32fns):
* src/w32font.c (w32_enumfont_pattern_entity, syms_of_w32font):
* src/w32term.c (w32_bitmap_icon, syms_of_w32term):
* src/xdisp.c (message_dolog, define_frame_cursor1)
(syms_of_xdisp):
* src/xfaces.c (tty_lookup_color, syms_of_xfaces):
* src/xml.c (make_dom, syms_of_xml):
* src/xterm.c (syms_of_xterm):
* src/xwidget.c (store_xwidget_download_callback_event)
(store_xwidget_js_callback_event, syms_of_xwidget): Define
symbols for symbols interned with `intern' from a constant
string, delete duplicate DEFSYM directives, and substitute them
for such calls to intern. This excludes only those symbols
which are interned and referenced only once during Emacs's
initialization, the timing of whose interning is
inconsequential, and symbols in w32.c, which would need to be
transferred to a new syms_of_w32 function that I cannot test.
Diffstat (limited to 'src/gnutls.c')
| -rw-r--r-- | src/gnutls.c | 162 |
1 files changed, 103 insertions, 59 deletions
diff --git a/src/gnutls.c b/src/gnutls.c index 54b7eb4c90e..efee2dccbb4 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -1142,7 +1142,7 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) | |||
| 1142 | int version = gnutls_x509_crt_get_version (cert); | 1142 | int version = gnutls_x509_crt_get_version (cert); |
| 1143 | check_memory_full (version); | 1143 | check_memory_full (version); |
| 1144 | if (version >= GNUTLS_E_SUCCESS) | 1144 | if (version >= GNUTLS_E_SUCCESS) |
| 1145 | res = nconc2 (res, list2 (intern (":version"), | 1145 | res = nconc2 (res, list2 (QCversion, |
| 1146 | make_fixnum (version))); | 1146 | make_fixnum (version))); |
| 1147 | } | 1147 | } |
| 1148 | 1148 | ||
| @@ -1156,7 +1156,7 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) | |||
| 1156 | err = gnutls_x509_crt_get_serial (cert, serial, &buf_size); | 1156 | err = gnutls_x509_crt_get_serial (cert, serial, &buf_size); |
| 1157 | check_memory_full (err); | 1157 | check_memory_full (err); |
| 1158 | if (err >= GNUTLS_E_SUCCESS) | 1158 | if (err >= GNUTLS_E_SUCCESS) |
| 1159 | res = nconc2 (res, list2 (intern (":serial-number"), | 1159 | res = nconc2 (res, list2 (QCserial_number, |
| 1160 | gnutls_hex_string (serial, buf_size, ""))); | 1160 | gnutls_hex_string (serial, buf_size, ""))); |
| 1161 | xfree (serial); | 1161 | xfree (serial); |
| 1162 | } | 1162 | } |
| @@ -1171,7 +1171,7 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) | |||
| 1171 | err = gnutls_x509_crt_get_issuer_dn (cert, dn, &buf_size); | 1171 | err = gnutls_x509_crt_get_issuer_dn (cert, dn, &buf_size); |
| 1172 | check_memory_full (err); | 1172 | check_memory_full (err); |
| 1173 | if (err >= GNUTLS_E_SUCCESS) | 1173 | if (err >= GNUTLS_E_SUCCESS) |
| 1174 | res = nconc2 (res, list2 (intern (":issuer"), | 1174 | res = nconc2 (res, list2 (QCissuer, |
| 1175 | make_string (dn, buf_size))); | 1175 | make_string (dn, buf_size))); |
| 1176 | xfree (dn); | 1176 | xfree (dn); |
| 1177 | } | 1177 | } |
| @@ -1185,11 +1185,11 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) | |||
| 1185 | time_t tim = gnutls_x509_crt_get_activation_time (cert); | 1185 | time_t tim = gnutls_x509_crt_get_activation_time (cert); |
| 1186 | 1186 | ||
| 1187 | if (gmtime_r (&tim, &t) && strftime (buf, sizeof buf, "%Y-%m-%d", &t)) | 1187 | if (gmtime_r (&tim, &t) && strftime (buf, sizeof buf, "%Y-%m-%d", &t)) |
| 1188 | res = nconc2 (res, list2 (intern (":valid-from"), build_string (buf))); | 1188 | res = nconc2 (res, list2 (QCvalid_from, build_string (buf))); |
| 1189 | 1189 | ||
| 1190 | tim = gnutls_x509_crt_get_expiration_time (cert); | 1190 | tim = gnutls_x509_crt_get_expiration_time (cert); |
| 1191 | if (gmtime_r (&tim, &t) && strftime (buf, sizeof buf, "%Y-%m-%d", &t)) | 1191 | if (gmtime_r (&tim, &t) && strftime (buf, sizeof buf, "%Y-%m-%d", &t)) |
| 1192 | res = nconc2 (res, list2 (intern (":valid-to"), build_string (buf))); | 1192 | res = nconc2 (res, list2 (QCvalid_to, build_string (buf))); |
| 1193 | } | 1193 | } |
| 1194 | 1194 | ||
| 1195 | /* Subject. */ | 1195 | /* Subject. */ |
| @@ -1202,7 +1202,7 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) | |||
| 1202 | err = gnutls_x509_crt_get_dn (cert, dn, &buf_size); | 1202 | err = gnutls_x509_crt_get_dn (cert, dn, &buf_size); |
| 1203 | check_memory_full (err); | 1203 | check_memory_full (err); |
| 1204 | if (err >= GNUTLS_E_SUCCESS) | 1204 | if (err >= GNUTLS_E_SUCCESS) |
| 1205 | res = nconc2 (res, list2 (intern (":subject"), | 1205 | res = nconc2 (res, list2 (QCsubject, |
| 1206 | make_string (dn, buf_size))); | 1206 | make_string (dn, buf_size))); |
| 1207 | xfree (dn); | 1207 | xfree (dn); |
| 1208 | } | 1208 | } |
| @@ -1217,12 +1217,12 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) | |||
| 1217 | { | 1217 | { |
| 1218 | const char *name = gnutls_pk_algorithm_get_name (err); | 1218 | const char *name = gnutls_pk_algorithm_get_name (err); |
| 1219 | if (name) | 1219 | if (name) |
| 1220 | res = nconc2 (res, list2 (intern (":public-key-algorithm"), | 1220 | res = nconc2 (res, list2 (QCpublic_key_algorithm, |
| 1221 | build_string (name))); | 1221 | build_string (name))); |
| 1222 | 1222 | ||
| 1223 | name = gnutls_sec_param_get_name (gnutls_pk_bits_to_sec_param | 1223 | name = gnutls_sec_param_get_name (gnutls_pk_bits_to_sec_param |
| 1224 | (err, bits)); | 1224 | (err, bits)); |
| 1225 | res = nconc2 (res, list2 (intern (":certificate-security-level"), | 1225 | res = nconc2 (res, list2 (QCcertificate_security_level, |
| 1226 | build_string (name))); | 1226 | build_string (name))); |
| 1227 | } | 1227 | } |
| 1228 | } | 1228 | } |
| @@ -1237,7 +1237,7 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) | |||
| 1237 | err = gnutls_x509_crt_get_issuer_unique_id (cert, buf, &buf_size); | 1237 | err = gnutls_x509_crt_get_issuer_unique_id (cert, buf, &buf_size); |
| 1238 | check_memory_full (err); | 1238 | check_memory_full (err); |
| 1239 | if (err >= GNUTLS_E_SUCCESS) | 1239 | if (err >= GNUTLS_E_SUCCESS) |
| 1240 | res = nconc2 (res, list2 (intern (":issuer-unique-id"), | 1240 | res = nconc2 (res, list2 (QCissuer_unique_id, |
| 1241 | make_string (buf, buf_size))); | 1241 | make_string (buf, buf_size))); |
| 1242 | xfree (buf); | 1242 | xfree (buf); |
| 1243 | } | 1243 | } |
| @@ -1251,7 +1251,7 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) | |||
| 1251 | err = gnutls_x509_crt_get_subject_unique_id (cert, buf, &buf_size); | 1251 | err = gnutls_x509_crt_get_subject_unique_id (cert, buf, &buf_size); |
| 1252 | check_memory_full (err); | 1252 | check_memory_full (err); |
| 1253 | if (err >= GNUTLS_E_SUCCESS) | 1253 | if (err >= GNUTLS_E_SUCCESS) |
| 1254 | res = nconc2 (res, list2 (intern (":subject-unique-id"), | 1254 | res = nconc2 (res, list2 (QCsubject_unique_id, |
| 1255 | make_string (buf, buf_size))); | 1255 | make_string (buf, buf_size))); |
| 1256 | xfree (buf); | 1256 | xfree (buf); |
| 1257 | } | 1257 | } |
| @@ -1263,7 +1263,7 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) | |||
| 1263 | { | 1263 | { |
| 1264 | const char *name = gnutls_sign_get_name (err); | 1264 | const char *name = gnutls_sign_get_name (err); |
| 1265 | if (name) | 1265 | if (name) |
| 1266 | res = nconc2 (res, list2 (intern (":signature-algorithm"), | 1266 | res = nconc2 (res, list2 (QCsignature_algorithm, |
| 1267 | build_string (name))); | 1267 | build_string (name))); |
| 1268 | } | 1268 | } |
| 1269 | 1269 | ||
| @@ -1277,7 +1277,7 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) | |||
| 1277 | err = gnutls_x509_crt_get_key_id (cert, 0, buf, &buf_size); | 1277 | err = gnutls_x509_crt_get_key_id (cert, 0, buf, &buf_size); |
| 1278 | check_memory_full (err); | 1278 | check_memory_full (err); |
| 1279 | if (err >= GNUTLS_E_SUCCESS) | 1279 | if (err >= GNUTLS_E_SUCCESS) |
| 1280 | res = nconc2 (res, list2 (intern (":public-key-id"), | 1280 | res = nconc2 (res, list2 (QCpublic_key_id, |
| 1281 | gnutls_hex_string (buf, buf_size, "sha1:"))); | 1281 | gnutls_hex_string (buf, buf_size, "sha1:"))); |
| 1282 | xfree (buf); | 1282 | xfree (buf); |
| 1283 | } | 1283 | } |
| @@ -1293,7 +1293,7 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) | |||
| 1293 | err = gnutls_x509_crt_get_key_id (cert, GNUTLS_KEYID_USE_SHA256, buf, &buf_size); | 1293 | err = gnutls_x509_crt_get_key_id (cert, GNUTLS_KEYID_USE_SHA256, buf, &buf_size); |
| 1294 | check_memory_full (err); | 1294 | check_memory_full (err); |
| 1295 | if (err >= GNUTLS_E_SUCCESS) | 1295 | if (err >= GNUTLS_E_SUCCESS) |
| 1296 | res = nconc2 (res, list2 (intern (":public-key-id-sha256"), | 1296 | res = nconc2 (res, list2 (QCpublic_key_id_sha256, |
| 1297 | gnutls_hex_string (buf, buf_size, "sha256:"))); | 1297 | gnutls_hex_string (buf, buf_size, "sha256:"))); |
| 1298 | xfree (buf); | 1298 | xfree (buf); |
| 1299 | } | 1299 | } |
| @@ -1311,13 +1311,13 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) | |||
| 1311 | buf, &buf_size); | 1311 | buf, &buf_size); |
| 1312 | check_memory_full (err); | 1312 | check_memory_full (err); |
| 1313 | if (err >= GNUTLS_E_SUCCESS) | 1313 | if (err >= GNUTLS_E_SUCCESS) |
| 1314 | res = nconc2 (res, list2 (intern (":certificate-id"), | 1314 | res = nconc2 (res, list2 (QCcertificate_id, |
| 1315 | gnutls_hex_string (buf, buf_size, "sha1:"))); | 1315 | gnutls_hex_string (buf, buf_size, "sha1:"))); |
| 1316 | xfree (buf); | 1316 | xfree (buf); |
| 1317 | } | 1317 | } |
| 1318 | 1318 | ||
| 1319 | /* PEM */ | 1319 | /* PEM */ |
| 1320 | res = nconc2 (res, list2 (intern (":pem"), | 1320 | res = nconc2 (res, list2 (QCpem, |
| 1321 | emacs_gnutls_certificate_export_pem(cert))); | 1321 | emacs_gnutls_certificate_export_pem(cert))); |
| 1322 | 1322 | ||
| 1323 | return res; | 1323 | return res; |
| @@ -1329,55 +1329,55 @@ DEFUN ("gnutls-peer-status-warning-describe", Fgnutls_peer_status_warning_descri | |||
| 1329 | { | 1329 | { |
| 1330 | CHECK_SYMBOL (status_symbol); | 1330 | CHECK_SYMBOL (status_symbol); |
| 1331 | 1331 | ||
| 1332 | if (EQ (status_symbol, intern (":invalid"))) | 1332 | if (EQ (status_symbol, QCinvalid)) |
| 1333 | return build_string ("certificate could not be verified"); | 1333 | return build_string ("certificate could not be verified"); |
| 1334 | 1334 | ||
| 1335 | if (EQ (status_symbol, intern (":revoked"))) | 1335 | if (EQ (status_symbol, QCrevoked)) |
| 1336 | return build_string ("certificate was revoked (CRL)"); | 1336 | return build_string ("certificate was revoked (CRL)"); |
| 1337 | 1337 | ||
| 1338 | if (EQ (status_symbol, intern (":self-signed"))) | 1338 | if (EQ (status_symbol, QCself_signed)) |
| 1339 | return build_string ("certificate signer was not found (self-signed)"); | 1339 | return build_string ("certificate signer was not found (self-signed)"); |
| 1340 | 1340 | ||
| 1341 | if (EQ (status_symbol, intern (":unknown-ca"))) | 1341 | if (EQ (status_symbol, QCunknown_ca)) |
| 1342 | return build_string ("the certificate was signed by an unknown " | 1342 | return build_string ("the certificate was signed by an unknown " |
| 1343 | "and therefore untrusted authority"); | 1343 | "and therefore untrusted authority"); |
| 1344 | 1344 | ||
| 1345 | if (EQ (status_symbol, intern (":not-ca"))) | 1345 | if (EQ (status_symbol, QCnot_ca)) |
| 1346 | return build_string ("certificate signer is not a CA"); | 1346 | return build_string ("certificate signer is not a CA"); |
| 1347 | 1347 | ||
| 1348 | if (EQ (status_symbol, intern (":insecure"))) | 1348 | if (EQ (status_symbol, QCinsecure)) |
| 1349 | return build_string ("certificate was signed with an insecure algorithm"); | 1349 | return build_string ("certificate was signed with an insecure algorithm"); |
| 1350 | 1350 | ||
| 1351 | if (EQ (status_symbol, intern (":not-activated"))) | 1351 | if (EQ (status_symbol, QCnot_activated)) |
| 1352 | return build_string ("certificate is not yet activated"); | 1352 | return build_string ("certificate is not yet activated"); |
| 1353 | 1353 | ||
| 1354 | if (EQ (status_symbol, intern (":expired"))) | 1354 | if (EQ (status_symbol, QCexpired)) |
| 1355 | return build_string ("certificate has expired"); | 1355 | return build_string ("certificate has expired"); |
| 1356 | 1356 | ||
| 1357 | if (EQ (status_symbol, intern (":no-host-match"))) | 1357 | if (EQ (status_symbol, QCno_host_match)) |
| 1358 | return build_string ("certificate host does not match hostname"); | 1358 | return build_string ("certificate host does not match hostname"); |
| 1359 | 1359 | ||
| 1360 | if (EQ (status_symbol, intern (":signature-failure"))) | 1360 | if (EQ (status_symbol, QCsignature_failure)) |
| 1361 | return build_string ("certificate signature could not be verified"); | 1361 | return build_string ("certificate signature could not be verified"); |
| 1362 | 1362 | ||
| 1363 | if (EQ (status_symbol, intern (":revocation-data-superseded"))) | 1363 | if (EQ (status_symbol, QCrevocation_data_superseded)) |
| 1364 | return build_string ("certificate revocation data are old and have been " | 1364 | return build_string ("certificate revocation data are old and have been " |
| 1365 | "superseded"); | 1365 | "superseded"); |
| 1366 | 1366 | ||
| 1367 | if (EQ (status_symbol, intern (":revocation-data-issued-in-future"))) | 1367 | if (EQ (status_symbol, QCrevocation_data_issued_in_future)) |
| 1368 | return build_string ("certificate revocation data have a future issue date"); | 1368 | return build_string ("certificate revocation data have a future issue date"); |
| 1369 | 1369 | ||
| 1370 | if (EQ (status_symbol, intern (":signer-constraints-failure"))) | 1370 | if (EQ (status_symbol, QCsigner_constraints_failure)) |
| 1371 | return build_string ("certificate signer constraints were violated"); | 1371 | return build_string ("certificate signer constraints were violated"); |
| 1372 | 1372 | ||
| 1373 | if (EQ (status_symbol, intern (":purpose-mismatch"))) | 1373 | if (EQ (status_symbol, QCpurpose_mismatch)) |
| 1374 | return build_string ("certificate does not match the intended purpose"); | 1374 | return build_string ("certificate does not match the intended purpose"); |
| 1375 | 1375 | ||
| 1376 | if (EQ (status_symbol, intern (":missing-ocsp-status"))) | 1376 | if (EQ (status_symbol, QCmissing_ocsp_status)) |
| 1377 | return build_string ("certificate requires the server to send a OCSP " | 1377 | return build_string ("certificate requires the server to send a OCSP " |
| 1378 | "certificate status, but no status was received"); | 1378 | "certificate status, but no status was received"); |
| 1379 | 1379 | ||
| 1380 | if (EQ (status_symbol, intern (":invalid-ocsp-status"))) | 1380 | if (EQ (status_symbol, QCinvalid_ocsp_status)) |
| 1381 | return build_string ("the received OCSP certificate status is invalid"); | 1381 | return build_string ("the received OCSP certificate status is invalid"); |
| 1382 | 1382 | ||
| 1383 | return Qnil; | 1383 | return Qnil; |
| @@ -1411,50 +1411,50 @@ returned as the :certificate entry. */) | |||
| 1411 | verification = XPROCESS (proc)->gnutls_peer_verification; | 1411 | verification = XPROCESS (proc)->gnutls_peer_verification; |
| 1412 | 1412 | ||
| 1413 | if (verification & GNUTLS_CERT_INVALID) | 1413 | if (verification & GNUTLS_CERT_INVALID) |
| 1414 | warnings = Fcons (intern (":invalid"), warnings); | 1414 | warnings = Fcons (QCinvalid, warnings); |
| 1415 | 1415 | ||
| 1416 | if (verification & GNUTLS_CERT_REVOKED) | 1416 | if (verification & GNUTLS_CERT_REVOKED) |
| 1417 | warnings = Fcons (intern (":revoked"), warnings); | 1417 | warnings = Fcons (QCrevoked, warnings); |
| 1418 | 1418 | ||
| 1419 | if (verification & GNUTLS_CERT_SIGNER_NOT_FOUND) | 1419 | if (verification & GNUTLS_CERT_SIGNER_NOT_FOUND) |
| 1420 | warnings = Fcons (intern (":unknown-ca"), warnings); | 1420 | warnings = Fcons (QCunknown_ca, warnings); |
| 1421 | 1421 | ||
| 1422 | if (verification & GNUTLS_CERT_SIGNER_NOT_CA) | 1422 | if (verification & GNUTLS_CERT_SIGNER_NOT_CA) |
| 1423 | warnings = Fcons (intern (":not-ca"), warnings); | 1423 | warnings = Fcons (QCnot_ca, warnings); |
| 1424 | 1424 | ||
| 1425 | if (verification & GNUTLS_CERT_INSECURE_ALGORITHM) | 1425 | if (verification & GNUTLS_CERT_INSECURE_ALGORITHM) |
| 1426 | warnings = Fcons (intern (":insecure"), warnings); | 1426 | warnings = Fcons (QCinsecure, warnings); |
| 1427 | 1427 | ||
| 1428 | if (verification & GNUTLS_CERT_NOT_ACTIVATED) | 1428 | if (verification & GNUTLS_CERT_NOT_ACTIVATED) |
| 1429 | warnings = Fcons (intern (":not-activated"), warnings); | 1429 | warnings = Fcons (QCnot_activated, warnings); |
| 1430 | 1430 | ||
| 1431 | if (verification & GNUTLS_CERT_EXPIRED) | 1431 | if (verification & GNUTLS_CERT_EXPIRED) |
| 1432 | warnings = Fcons (intern (":expired"), warnings); | 1432 | warnings = Fcons (QCexpired, warnings); |
| 1433 | 1433 | ||
| 1434 | # if GNUTLS_VERSION_NUMBER >= 0x030100 | 1434 | # if GNUTLS_VERSION_NUMBER >= 0x030100 |
| 1435 | if (verification & GNUTLS_CERT_SIGNATURE_FAILURE) | 1435 | if (verification & GNUTLS_CERT_SIGNATURE_FAILURE) |
| 1436 | warnings = Fcons (intern (":signature-failure"), warnings); | 1436 | warnings = Fcons (QCsignature_failure, warnings); |
| 1437 | 1437 | ||
| 1438 | # if GNUTLS_VERSION_NUMBER >= 0x030114 | 1438 | # if GNUTLS_VERSION_NUMBER >= 0x030114 |
| 1439 | if (verification & GNUTLS_CERT_REVOCATION_DATA_SUPERSEDED) | 1439 | if (verification & GNUTLS_CERT_REVOCATION_DATA_SUPERSEDED) |
| 1440 | warnings = Fcons (intern (":revocation-data-superseded"), warnings); | 1440 | warnings = Fcons (QCrevocation_data_superseded, warnings); |
| 1441 | 1441 | ||
| 1442 | if (verification & GNUTLS_CERT_REVOCATION_DATA_ISSUED_IN_FUTURE) | 1442 | if (verification & GNUTLS_CERT_REVOCATION_DATA_ISSUED_IN_FUTURE) |
| 1443 | warnings = Fcons (intern (":revocation-data-issued-in-future"), warnings); | 1443 | warnings = Fcons (QCrevocation_data_issued_in_future, warnings); |
| 1444 | 1444 | ||
| 1445 | if (verification & GNUTLS_CERT_SIGNER_CONSTRAINTS_FAILURE) | 1445 | if (verification & GNUTLS_CERT_SIGNER_CONSTRAINTS_FAILURE) |
| 1446 | warnings = Fcons (intern (":signer-constraints-failure"), warnings); | 1446 | warnings = Fcons (QCsigner_constraints_failure, warnings); |
| 1447 | 1447 | ||
| 1448 | # if GNUTLS_VERSION_NUMBER >= 0x030400 | 1448 | # if GNUTLS_VERSION_NUMBER >= 0x030400 |
| 1449 | if (verification & GNUTLS_CERT_PURPOSE_MISMATCH) | 1449 | if (verification & GNUTLS_CERT_PURPOSE_MISMATCH) |
| 1450 | warnings = Fcons (intern (":purpose-mismatch"), warnings); | 1450 | warnings = Fcons (QCpurpose_mismatch, warnings); |
| 1451 | 1451 | ||
| 1452 | # if GNUTLS_VERSION_NUMBER >= 0x030501 | 1452 | # if GNUTLS_VERSION_NUMBER >= 0x030501 |
| 1453 | if (verification & GNUTLS_CERT_MISSING_OCSP_STATUS) | 1453 | if (verification & GNUTLS_CERT_MISSING_OCSP_STATUS) |
| 1454 | warnings = Fcons (intern (":missing-ocsp-status"), warnings); | 1454 | warnings = Fcons (QCmissing_ocsp_status, warnings); |
| 1455 | 1455 | ||
| 1456 | if (verification & GNUTLS_CERT_INVALID_OCSP_STATUS) | 1456 | if (verification & GNUTLS_CERT_INVALID_OCSP_STATUS) |
| 1457 | warnings = Fcons (intern (":invalid-ocsp-status"), warnings); | 1457 | warnings = Fcons (QCinvalid_ocsp_status, warnings); |
| 1458 | # endif | 1458 | # endif |
| 1459 | # endif | 1459 | # endif |
| 1460 | # endif | 1460 | # endif |
| @@ -1462,17 +1462,17 @@ returned as the :certificate entry. */) | |||
| 1462 | 1462 | ||
| 1463 | if (XPROCESS (proc)->gnutls_extra_peer_verification & | 1463 | if (XPROCESS (proc)->gnutls_extra_peer_verification & |
| 1464 | CERTIFICATE_NOT_MATCHING) | 1464 | CERTIFICATE_NOT_MATCHING) |
| 1465 | warnings = Fcons (intern (":no-host-match"), warnings); | 1465 | warnings = Fcons (QCno_host_match, warnings); |
| 1466 | 1466 | ||
| 1467 | /* This could get called in the INIT stage, when the certificate is | 1467 | /* This could get called in the INIT stage, when the certificate is |
| 1468 | not yet set. */ | 1468 | not yet set. */ |
| 1469 | if (XPROCESS (proc)->gnutls_certificates != NULL && | 1469 | if (XPROCESS (proc)->gnutls_certificates != NULL && |
| 1470 | gnutls_x509_crt_check_issuer(XPROCESS (proc)->gnutls_certificates[0], | 1470 | gnutls_x509_crt_check_issuer(XPROCESS (proc)->gnutls_certificates[0], |
| 1471 | XPROCESS (proc)->gnutls_certificates[0])) | 1471 | XPROCESS (proc)->gnutls_certificates[0])) |
| 1472 | warnings = Fcons (intern (":self-signed"), warnings); | 1472 | warnings = Fcons (QCself_signed, warnings); |
| 1473 | 1473 | ||
| 1474 | if (!NILP (warnings)) | 1474 | if (!NILP (warnings)) |
| 1475 | result = list2 (intern (":warnings"), warnings); | 1475 | result = list2 (QCwarnings, warnings); |
| 1476 | 1476 | ||
| 1477 | /* This could get called in the INIT stage, when the certificate is | 1477 | /* This could get called in the INIT stage, when the certificate is |
| 1478 | not yet set. */ | 1478 | not yet set. */ |
| @@ -1485,11 +1485,11 @@ returned as the :certificate entry. */) | |||
| 1485 | certs = nconc2 (certs, list1 (emacs_gnutls_certificate_details | 1485 | certs = nconc2 (certs, list1 (emacs_gnutls_certificate_details |
| 1486 | (XPROCESS (proc)->gnutls_certificates[i]))); | 1486 | (XPROCESS (proc)->gnutls_certificates[i]))); |
| 1487 | 1487 | ||
| 1488 | result = nconc2 (result, list2 (intern (":certificates"), certs)); | 1488 | result = nconc2 (result, list2 (QCcertificates, certs)); |
| 1489 | 1489 | ||
| 1490 | /* Return the host certificate in its own element for | 1490 | /* Return the host certificate in its own element for |
| 1491 | compatibility reasons. */ | 1491 | compatibility reasons. */ |
| 1492 | result = nconc2 (result, list2 (intern (":certificate"), Fcar (certs))); | 1492 | result = nconc2 (result, list2 (QCcertificate, Fcar (certs))); |
| 1493 | } | 1493 | } |
| 1494 | 1494 | ||
| 1495 | state = XPROCESS (proc)->gnutls_state; | 1495 | state = XPROCESS (proc)->gnutls_state; |
| @@ -1499,38 +1499,38 @@ returned as the :certificate entry. */) | |||
| 1499 | int bits = gnutls_dh_get_prime_bits (state); | 1499 | int bits = gnutls_dh_get_prime_bits (state); |
| 1500 | check_memory_full (bits); | 1500 | check_memory_full (bits); |
| 1501 | if (bits > 0) | 1501 | if (bits > 0) |
| 1502 | result = nconc2 (result, list2 (intern (":diffie-hellman-prime-bits"), | 1502 | result = nconc2 (result, list2 (QCdiffie_hellman_prime_bits, |
| 1503 | make_fixnum (bits))); | 1503 | make_fixnum (bits))); |
| 1504 | } | 1504 | } |
| 1505 | 1505 | ||
| 1506 | /* Key exchange. */ | 1506 | /* Key exchange. */ |
| 1507 | result = nconc2 | 1507 | result = nconc2 |
| 1508 | (result, list2 (intern (":key-exchange"), | 1508 | (result, list2 (QCkey_exchange, |
| 1509 | build_string (gnutls_kx_get_name | 1509 | build_string (gnutls_kx_get_name |
| 1510 | (gnutls_kx_get (state))))); | 1510 | (gnutls_kx_get (state))))); |
| 1511 | 1511 | ||
| 1512 | /* Protocol name. */ | 1512 | /* Protocol name. */ |
| 1513 | gnutls_protocol_t proto = gnutls_protocol_get_version (state); | 1513 | gnutls_protocol_t proto = gnutls_protocol_get_version (state); |
| 1514 | result = nconc2 | 1514 | result = nconc2 |
| 1515 | (result, list2 (intern (":protocol"), | 1515 | (result, list2 (QCprotocol, |
| 1516 | build_string (gnutls_protocol_get_name (proto)))); | 1516 | build_string (gnutls_protocol_get_name (proto)))); |
| 1517 | 1517 | ||
| 1518 | /* Cipher name. */ | 1518 | /* Cipher name. */ |
| 1519 | result = nconc2 | 1519 | result = nconc2 |
| 1520 | (result, list2 (intern (":cipher"), | 1520 | (result, list2 (QCcipher, |
| 1521 | build_string (gnutls_cipher_get_name | 1521 | build_string (gnutls_cipher_get_name |
| 1522 | (gnutls_cipher_get (state))))); | 1522 | (gnutls_cipher_get (state))))); |
| 1523 | 1523 | ||
| 1524 | /* MAC name. */ | 1524 | /* MAC name. */ |
| 1525 | result = nconc2 | 1525 | result = nconc2 |
| 1526 | (result, list2 (intern (":mac"), | 1526 | (result, list2 (QCmac, |
| 1527 | build_string (gnutls_mac_get_name | 1527 | build_string (gnutls_mac_get_name |
| 1528 | (gnutls_mac_get (state))))); | 1528 | (gnutls_mac_get (state))))); |
| 1529 | 1529 | ||
| 1530 | /* Compression name. */ | 1530 | /* Compression name. */ |
| 1531 | # ifdef HAVE_GNUTLS_COMPRESSION_GET | 1531 | # ifdef HAVE_GNUTLS_COMPRESSION_GET |
| 1532 | result = nconc2 | 1532 | result = nconc2 |
| 1533 | (result, list2 (intern (":compression"), | 1533 | (result, list2 (QCcompression, |
| 1534 | build_string (gnutls_compression_get_name | 1534 | build_string (gnutls_compression_get_name |
| 1535 | (gnutls_compression_get (state))))); | 1535 | (gnutls_compression_get (state))))); |
| 1536 | # endif | 1536 | # endif |
| @@ -1538,14 +1538,14 @@ returned as the :certificate entry. */) | |||
| 1538 | /* Encrypt-then-MAC. */ | 1538 | /* Encrypt-then-MAC. */ |
| 1539 | # ifdef HAVE_GNUTLS_ETM_STATUS | 1539 | # ifdef HAVE_GNUTLS_ETM_STATUS |
| 1540 | result = nconc2 | 1540 | result = nconc2 |
| 1541 | (result, list2 (intern (":encrypt-then-mac"), | 1541 | (result, list2 (QCencrypt_then_mac, |
| 1542 | gnutls_session_etm_status (state) ? Qt : Qnil)); | 1542 | gnutls_session_etm_status (state) ? Qt : Qnil)); |
| 1543 | # endif | 1543 | # endif |
| 1544 | 1544 | ||
| 1545 | /* Renegotiation Indication */ | 1545 | /* Renegotiation Indication */ |
| 1546 | if (proto <= GNUTLS_TLS1_2) | 1546 | if (proto <= GNUTLS_TLS1_2) |
| 1547 | result = nconc2 | 1547 | result = nconc2 |
| 1548 | (result, list2 (intern (":safe-renegotiation"), | 1548 | (result, list2 (QCsafe_renegotiation, |
| 1549 | gnutls_safe_renegotiation_status (state) ? Qt : Qnil)); | 1549 | gnutls_safe_renegotiation_status (state) ? Qt : Qnil)); |
| 1550 | 1550 | ||
| 1551 | return result; | 1551 | return result; |
| @@ -1701,7 +1701,7 @@ gnutls_verify_boot (Lisp_Object proc, Lisp_Object proplist) | |||
| 1701 | 1701 | ||
| 1702 | p->gnutls_peer_verification = peer_verification; | 1702 | p->gnutls_peer_verification = peer_verification; |
| 1703 | 1703 | ||
| 1704 | warnings = plist_get (Fgnutls_peer_status (proc), intern (":warnings")); | 1704 | warnings = plist_get (Fgnutls_peer_status (proc), QCwarnings); |
| 1705 | if (!NILP (warnings)) | 1705 | if (!NILP (warnings)) |
| 1706 | { | 1706 | { |
| 1707 | for (Lisp_Object tail = warnings; CONSP (tail); tail = XCDR (tail)) | 1707 | for (Lisp_Object tail = warnings; CONSP (tail); tail = XCDR (tail)) |
| @@ -3119,4 +3119,48 @@ are as per the GnuTLS logging conventions. */); | |||
| 3119 | #endif /* HAVE_GNUTLS */ | 3119 | #endif /* HAVE_GNUTLS */ |
| 3120 | 3120 | ||
| 3121 | defsubr (&Sgnutls_available_p); | 3121 | defsubr (&Sgnutls_available_p); |
| 3122 | |||
| 3123 | DEFSYM (QCcertificate, ":certificate"); | ||
| 3124 | DEFSYM (QCcertificate_id, ":certificate-id"); | ||
| 3125 | DEFSYM (QCcertificate_security_level, ":certificate-security-level"); | ||
| 3126 | DEFSYM (QCcertificates, ":certificates"); | ||
| 3127 | DEFSYM (QCcipher, ":cipher"); | ||
| 3128 | DEFSYM (QCcompression, ":compression"); | ||
| 3129 | DEFSYM (QCdiffie_hellman_prime_bits, ":diffie-hellman-prime-bits"); | ||
| 3130 | DEFSYM (QCencrypt_then_mac, ":encrypt-then-mac"); | ||
| 3131 | DEFSYM (QCexpired, ":expired"); | ||
| 3132 | DEFSYM (QCinsecure, ":insecure"); | ||
| 3133 | DEFSYM (QCinvalid, ":invalid"); | ||
| 3134 | DEFSYM (QCinvalid_ocsp_status, ":invalid-ocsp-status"); | ||
| 3135 | DEFSYM (QCissuer, ":issuer"); | ||
| 3136 | DEFSYM (QCissuer_unique_id, ":issuer-unique-id"); | ||
| 3137 | DEFSYM (QCkey_exchange, ":key-exchange"); | ||
| 3138 | DEFSYM (QCmac, ":mac"); | ||
| 3139 | DEFSYM (QCmissing_ocsp_status, ":missing-ocsp-status"); | ||
| 3140 | DEFSYM (QCno_host_match, ":no-host-match"); | ||
| 3141 | DEFSYM (QCnot_activated, ":not-activated"); | ||
| 3142 | DEFSYM (QCnot_ca, ":not-ca"); | ||
| 3143 | DEFSYM (QCpem, ":pem"); | ||
| 3144 | DEFSYM (QCprotocol, ":protocol"); | ||
| 3145 | DEFSYM (QCpublic_key_algorithm, ":public-key-algorithm"); | ||
| 3146 | DEFSYM (QCpublic_key_id, ":public-key-id"); | ||
| 3147 | DEFSYM (QCpublic_key_id_sha256, ":public-key-id-sha256"); | ||
| 3148 | DEFSYM (QCpurpose_mismatch, ":purpose-mismatch"); | ||
| 3149 | DEFSYM (QCrevocation_data_issued_in_future, | ||
| 3150 | ":revocation-data-issued-in-future"); | ||
| 3151 | DEFSYM (QCrevocation_data_superseded, ":revocation-data-superseded"); | ||
| 3152 | DEFSYM (QCrevoked, ":revoked"); | ||
| 3153 | DEFSYM (QCsafe_renegotiation, ":safe-renegotiation"); | ||
| 3154 | DEFSYM (QCself_signed, ":self-signed"); | ||
| 3155 | DEFSYM (QCserial_number, ":serial-number"); | ||
| 3156 | DEFSYM (QCsignature_algorithm, ":signature-algorithm"); | ||
| 3157 | DEFSYM (QCsignature_failure, ":signature-failure"); | ||
| 3158 | DEFSYM (QCsigner_constraints_failure, ":signer-constraints-failure"); | ||
| 3159 | DEFSYM (QCsubject, ":subject"); | ||
| 3160 | DEFSYM (QCsubject_unique_id, ":subject-unique-id"); | ||
| 3161 | DEFSYM (QCunknown_ca, ":unknown-ca"); | ||
| 3162 | DEFSYM (QCvalid_from, ":valid-from"); | ||
| 3163 | DEFSYM (QCvalid_to, ":valid-to"); | ||
| 3164 | DEFSYM (QCversion, ":version"); | ||
| 3165 | DEFSYM (QCwarnings, ":warnings"); | ||
| 3122 | } | 3166 | } |