德尔福Indy SRP

时间:2015-10-24 09:02:59

标签: delphi openssl indy single-responsibility-principle

Goodmorning everyone。

我试图在Delphi中实现SRP。 浏览来源Indy 10我找到了以下代码:

  {$EXTERNALSYM SRP_user_pwd}
  SRP_user_pwd = record
      id  : PIdAnsiChar;
    s : PBIGNUM;
    v : PBIGNUM;
      g : PBIGNUM;
      N : PBIGNUM;
    info : PIdAnsiChar;
  end;
  {$EXTERNALSYM PSRP_user_pwd}
  PSRP_user_pwd = ^SRP_user_pwd;

我假设您已经实施了协议SRP,但找不到任何可以帮助我直接使用它的内容。

此时我试图翻译我在此链接中找到的内容:https://github.com/cocagne/csrp/blob/master/srp.c

所以我试图从图书馆openssl中导入我需要的功能,如下所示:

initialization

  LoadOpenSSLLibrary;

  @BN_num_bytes:= GetProcAddress( GetCryptLibHandle, PChar( 'BN_num_bytes' ) );
  @BN_bn2bin:= GetProcAddress( GetCryptLibHandle, PChar( 'BN_bn2bin' ) );
  @BN_bin2bn:= GetProcAddress( GetCryptLibHandle, PChar( 'BN_bin2bn' ) );
  @SHA512 := GetProcAddress( GetCryptLibHandle, PChar( 'SHA512' ) );
  @BN_CTX_new := GetProcAddress( GetCryptLibHandle, PChar( 'BN_CTX_new' ) );
  @BN_rand := GetProcAddress( GetCryptLibHandle, PChar( 'BN_rand' ) );
  @BN_mod_exp := GetProcAddress( GetCryptLibHandle, PChar( 'BN_mod_exp' ) );
  @BN_CTX_free := GetProcAddress( GetCryptLibHandle, PChar( 'BN_CTX_free' ) );

我找到了每个的条目,但没有找到函数BN_num_bytes。

在文档openssl https://www.openssl.org/docs/man1.0.2/crypto/BN_num_bytes.html中,函数存在,所以显然我做错了。

如果某人已经在Delphi中实施了SRP,我将非常感谢任何建议或代码:D。 否则建议如何使用我没有找到的Indy。 或者甚至是我可以调用这个函数,并继续努力为Delphi个人包装我可以包含的所有错误:(。

谢谢大家。

0 个答案:

没有答案
相关问题