Recent

Author Topic: [Solved] OpenSSL sign PKCS7  (Read 9491 times)

cristianorta

  • New member
  • *
  • Posts: 5
Re: [Solved] OpenSSL sign PKCS7
« Reply #15 on: June 12, 2021, 01:54:06 pm »
Replace
Code: Pascal  [Select][+][-]
  1.       bioc := BIO_new_mem_buf(@cbuf[1], Length(cbuf));
  2.  
  3.       fc := PEM_read_bio_X509(bioc, nil, nil, nil);
  4.  
  5.       biok := BIO_new_mem_buf(@kbuf[1], Length(kbuf));
  6.  
  7.       fk := PEM_read_bio_PrivateKey(biok, nil, nil, nil);
  8.  
  9.       biom := BIO_new_mem_buf(@pXml[1], Length(pXml));
  10.  
By
Code: Pascal  [Select][+][-]
  1.       bioc := BIO_new_mem_buf(@cbuf, Length(cbuf));
  2.  
  3.       fc := PEM_read_bio_X509(bioc, nil, nil, nil);
  4.  
  5.       biok := BIO_new_mem_buf(@kbuf, Length(kbuf));
  6.  
  7.       fk := PEM_read_bio_PrivateKey(biok, nil, nil, nil);
  8.  
  9.       biom := BIO_new_mem_buf(@pXml, Length(pXml));
  10.  
It works!

lainz

  • Hero Member
  • *****
  • Posts: 3828
Re: [Solved] OpenSSL sign PKCS7
« Reply #16 on: June 13, 2021, 01:09:44 am »
I will get it some day.

engkin

  • Hero Member
  • *****
  • Posts: 2857
Re: [Solved] OpenSSL sign PKCS7
« Reply #17 on: June 13, 2021, 02:56:31 am »
It works!

No, it does not!

Here is why:
Code: Pascal  [Select][+][-]
  1. program Project1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   {$IFDEF UNIX}{$IFDEF UseCThreads}
  7.   cthreads,
  8.   {$ENDIF}{$ENDIF}
  9.   Classes, SysUtils
  10.   { you can add units after this };
  11.  
  12. procedure test;
  13. var
  14.   s:String;
  15.   pc:pchar=pchar($45454545);
  16. begin
  17.   s:='ABC';
  18.   WriteLn('The fact: s=''',s,'''');
  19.   WriteLn('To point at the first letter in s...');
  20.   pc:=@s;
  21.   WriteLn('You think this works: @s --> ',pc^);
  22.   pc:=@s[1];
  23.   WriteLn('I think this works: @s[1] --> ',pc^);
  24. end;
  25.  
  26. begin
  27.   test;
  28.   ReadLn;
  29. end.
« Last Edit: June 13, 2021, 03:06:46 am by engkin »

lainz

  • Hero Member
  • *****
  • Posts: 3828
Re: [Solved] OpenSSL sign PKCS7
« Reply #18 on: June 13, 2021, 05:26:19 pm »
Machine vs human?

lainz

  • Hero Member
  • *****
  • Posts: 3828
Re: [Solved] OpenSSL sign PKCS7
« Reply #19 on: June 14, 2021, 11:56:56 pm »

 

TinyPortal © 2005-2018