2
0

uplink-common.pl 789 B

12345678910111213141516171819202122
  1. #!/usr/bin/env perl
  2. #
  3. # pull APPLINK_MAX value from applink.c...
  4. $applink_c=$0;
  5. $applink_c=~s|[^/\\]+$||g;
  6. $applink_c.="applink.c";
  7. open(INPUT,$applink_c) || die "can't open $applink_c: $!";
  8. @max=grep {/APPLINK_MAX\s+(\d+)/} <INPUT>;
  9. close(INPUT);
  10. ($#max==0) or die "can't find APPLINK_MAX in $applink_c";
  11. $max[0]=~/APPLINK_MAX\s+(\d+)/;
  12. $N=$1; # number of entries in OPENSSL_UplinkTable not including
  13. # OPENSSL_UplinkTable[0], which contains this value...
  14. 1;
  15. # Idea is to fill the OPENSSL_UplinkTable with pointers to stubs
  16. # which invoke 'void OPENSSL_Uplink (ULONG_PTR *table,int index)';
  17. # and then dereference themselves. Latter shall result in endless
  18. # loop *unless* OPENSSL_Uplink does not replace 'table[index]' with
  19. # something else, e.g. as 'table[index]=unimplemented;'...