- Timestamp:
- Oct 31, 2019, 9:13:12 PM (5 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/depend-gen.c
r383 r550 245 245 * 246 246 **************************************************/ 247 if (0 == strcmp(p, "sh_ gpg_chksum.h") ||247 if (0 == strcmp(p, "sh_sig_chksum.h") || 248 248 0 == strcmp(p, "sh_gpg_fp.h")) 249 249 { -
trunk/src/samhain.c
r541 r550 77 77 78 78 #include "sh_tiger.h" 79 #include "sh_ gpg.h"79 #include "sh_sig.h" 80 80 #include "sh_mem.h" 81 81 #include "sh_xfer.h" … … 1907 1907 #if defined(SH_WITH_SERVER) && !defined(SH_WITH_CLIENT) 1908 1908 1909 #if (defined(WITH_GPG) || defined(WITH_PGP))1909 #if defined(WITH_GPG) 1910 1910 /* log startup */ 1911 sh_ gpg_log_startup ();1911 sh_sig_log_startup (); 1912 1912 #else 1913 1913 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_1H, … … 1930 1930 if (sh.flag.checkSum == SH_CHECK_CHECK) 1931 1931 { 1932 #if (defined(WITH_GPG) || defined(WITH_PGP))1932 #if defined(WITH_GPG) 1933 1933 /* log startup */ 1934 sh_ gpg_log_startup ();1934 sh_sig_log_startup (); 1935 1935 #else 1936 1936 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_2H, … … 1942 1942 else 1943 1943 { 1944 #if (defined(WITH_GPG) || defined(WITH_PGP))1944 #if defined(WITH_GPG) 1945 1945 /* log startup */ 1946 sh_ gpg_log_startup ();1946 sh_sig_log_startup (); 1947 1947 #else 1948 1948 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_1H, -
trunk/src/sh_calls.c
r544 r550 533 533 534 534 long int retry_aud_execve (const char * file, int line, 535 const char *dateiname, char * argv[],536 char * envp[])535 const char *dateiname, char *const argv[], 536 char *const envp[]) 537 537 { 538 538 uid_t a = geteuid(); -
trunk/src/sh_dbIO.c
r543 r550 31 31 #include "sh_hash.h" 32 32 #include "sh_dbIO.h" 33 #include "sh_ gpg.h"33 #include "sh_sig.h" 34 34 #include "sh_tiger.h" 35 35 #include "sh_xfer.h" … … 852 852 static SL_TICKET verify_data (SL_TICKET fd) 853 853 { 854 #if defined(WITH_ GPG) || defined(WITH_PGP)854 #if defined(WITH_SIG) 855 855 SL_TICKET fdTmp; 856 856 857 857 /* extract the data and copy to temporary file 858 858 */ 859 fdTmp = sh_ gpg_extract_signed(fd);859 fdTmp = sh_sig_extract_signed(fd); 860 860 861 861 if (sig_termfast == 1) /* SIGTERM */ … … 871 871 /* Validate signature of open file. 872 872 */ 873 if (0 != sh_ gpg_check_sign(fd, SIG_DATA))873 if (0 != sh_sig_check_signature (fd, SIG_DATA)) 874 874 { 875 875 sl_close(fd); … … 877 877 } 878 878 sl_rewind (fd); 879 880 fdTmp = sh_sig_extract_signed_data(fd); 881 sl_close(fd); 882 fd = fdTmp; 879 883 #endif 880 884 -
trunk/src/sh_getopt.c
r543 r550 481 481 #ifdef WITH_GPG 482 482 if (num > 0) fputc ('\n', stdout); 483 printf (_(" GnuPG signatures (%s)"), DEFAULT_ GPG_PATH); ++num;484 #ifdef HAVE_ GPG_CHECKSUM485 if (num > 0) fputc ('\n', stdout); 486 printf (_(" -- GnuPG checksum: %s"), GPG_HASH); ++num;483 printf (_(" GnuPG signatures (%s)"), DEFAULT_SIG_PATH); ++num; 484 #ifdef HAVE_SIG_CHECKSUM 485 if (num > 0) fputc ('\n', stdout); 486 printf (_(" -- GnuPG checksum: %s"), SIG_HASH); ++num; 487 487 #endif 488 488 #ifdef USE_FINGERPRINT -
trunk/src/sh_hash.c
r534 r550 54 54 #include "sh_error.h" 55 55 #include "sh_tiger.h" 56 #include "sh_ gpg.h"56 #include "sh_sig.h" 57 57 #include "sh_unix.h" 58 58 #include "sh_files.h" -
trunk/src/sh_readconf.c
r514 r550 34 34 #include "sh_files.h" 35 35 #include "sh_xfer.h" 36 #include "sh_ gpg.h"36 #include "sh_sig.h" 37 37 #include "sh_hash.h" 38 38 #include "sh_dbIO.h" … … 352 352 SL_TICKET fdTmp = -1; 353 353 #endif 354 #if defined(WITH_ GPG) || defined(WITH_PGP)355 SL_TICKET fd Gpg= -1;354 #if defined(WITH_SIG) 355 SL_TICKET fdSIG = -1; 356 356 #endif 357 357 char * tmp; … … 369 369 char local_flag = 'R'; 370 370 371 #if defined(WITH_ GPG) || defined(WITH_PGP)371 #if defined(WITH_SIG) 372 372 int signed_content = S_FALSE; 373 373 int true_content = S_FALSE; … … 470 470 sl_write_line(fdTmp, line_in, sl_strlen(line_in)); 471 471 } 472 #if defined(WITH_ GPG) || defined(WITH_PGP)473 if ( 0 == sl_strncmp(line_in, _("-----END PGP SIGNATURE-----"), 25))472 #if defined(WITH_SIG) 473 if (S_TRUE == sh_sig_data_end(line_in)) 474 474 break; 475 475 #else … … 485 485 #endif 486 486 487 #if defined(WITH_ GPG) || defined(WITH_PGP)487 #if defined(WITH_SIG) 488 488 489 489 /* extract the data and copy to temporary file 490 490 */ 491 fd Gpg = sh_gpg_extract_signed(fd);491 fdSIG = sh_sig_extract_signed(fd); 492 492 493 493 sl_close(fd); 494 fd = fd Gpg;494 fd = fdSIG; 495 495 496 496 /* Validate signature of open file. 497 497 */ 498 if (0 != sh_ gpg_check_sign(fd, SIG_CONF))498 if (0 != sh_sig_check_signature (fd, SIG_CONF)) 499 499 { 500 500 SH_FREE(line_in); … … 520 520 /* Sun May 27 18:40:05 CEST 2001 521 521 */ 522 #if defined(WITH_ GPG) || defined(WITH_PGP)522 #if defined(WITH_SIG) 523 523 if (signed_content == S_FALSE) 524 524 { 525 if ( 0 == sl_strcmp(line, _("-----BEGIN PGP SIGNED MESSAGE-----")))525 if (S_TRUE == sh_sig_msg_start(line)) 526 526 signed_content = S_TRUE; 527 527 else 528 528 continue; 529 529 } 530 else if (true_content == S_FALSE) 531 { 532 if (line[0] == '\n') 533 true_content = S_TRUE; 534 else 535 continue; 536 } 537 else if (signed_content == S_TRUE) 530 else /* if (signed_content == S_TRUE) */ 538 531 { 539 if ( 0 == sl_strcmp(line, _("-----BEGIN PGP SIGNATURE-----")))532 if (S_TRUE == sh_sig_msg_end(line)) 540 533 break; 541 else if ( 0 == sl_strcmp(line, _("-----BEGIN PGP SIGNED MESSAGE-----")))534 else if (S_TRUE == sh_sig_msg_start(line)) 542 535 { 543 536 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, … … 551 544 aud_exit (FIL__, __LINE__,EXIT_FAILURE); 552 545 } 546 } 547 548 if (true_content == S_FALSE) /* continue if in header */ 549 { 550 if (S_TRUE == sh_sig_msg_startdata(line)) 551 true_content = S_TRUE; 552 else 553 continue; 553 554 } 554 555 #endif -
trunk/src/sh_tools.c
r541 r550 2075 2075 #endif 2076 2076 2077 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) || defined(SH_STEALTH) || defined(WITH_ GPG) || defined(WITH_PGP)2077 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) || defined(SH_STEALTH) || defined(WITH_SIG) 2078 2078 2079 2079 /* --------- secure temporary file ------------ */ -
trunk/src/sh_unix.c
r541 r550 5407 5407 { 5408 5408 int add_off = 0, llen; 5409 unsigned long bread; 5409 5410 static unsigned long off_data = 0; 5410 5411 static unsigned long max_data = 0; … … 5454 5455 /* --- Read one line. --- 5455 5456 */ 5456 add_off = hideout_hex_block(fd, (unsigned char *) str, len, &bytes_read); 5457 off_data += add_off; 5457 add_off = hideout_hex_block(fd, (unsigned char *) str, len, &bread); 5458 if (add_off > 0) 5459 off_data += add_off; 5460 bytes_read += bread; 5461 5462 if (bread == 0 || add_off <= 0) /* EOF */ 5463 str[0] = '\0'; 5458 5464 5459 5465 llen = sl_strlen(str); … … 5477 5483 ASSERT_RET((len > 1), _("len > 1"), (0)); 5478 5484 5485 str[0] = '\0'; 5486 *bytes_read = 0; 5479 5487 --len; 5480 5488 … … 5494 5502 do { 5495 5503 do { 5504 errno = 0; 5496 5505 num = sl_read (fd, &c, 1); 5497 5506 } while (num == 0 && errno == EINTR); 5498 5507 if (num > 0) 5499 5508 ++here; 5500 else if (num == 0) 5501 SL_RETURN((0), _("hideout_hex_block")); 5502 else 5509 else if (num == 0) { 5503 5510 SL_RETURN((-1), _("hideout_hex_block")); 5511 } 5512 else { 5513 SL_RETURN((-1), _("hideout_hex_block")); 5514 } 5504 5515 } while (c == '\n' || c == '\t' || c == '\r' || 5505 5516 c == ' '); … … 5523 5534 if (i != 0) 5524 5535 str[i] = '\0'; 5536 else if (str[0] == '\n') 5537 str[i+1] = '\0'; /* keep newline and terminate */ 5525 5538 else 5526 str[ i+1] = '\0'; /* keep newline and terminate */5539 str[0] = '\0'; 5527 5540 retval += here; 5528 5541 *bytes_read += (bread/8);
Note:
See TracChangeset
for help on using the changeset viewer.