• R/O
  • SSH
  • HTTPS

ttssh2: コミット


コミットメタ情報

リビジョン6570 (tree)
日時2017-01-15 14:28:14
作者(del#24082)

ログメッセージ

ECDSA_SIG構造体のメンバーアクセスを関数アクセスに変更した。

変更サマリ

差分

--- branches/openssl_1_1_0/ttssh2/ttxssh/key.c (revision 6569)
+++ branches/openssl_1_1_0/ttssh2/ttxssh/key.c (revision 6570)
@@ -347,6 +347,7 @@
347347 unsigned int len, dlen;
348348 int ret, nid = NID_undef;
349349 char *ptr;
350+ BIGNUM *r, *s;
350351
351352 OpenSSL_add_all_digests();
352353
@@ -375,13 +376,14 @@
375376 /* parse signature */
376377 if ((sig = ECDSA_SIG_new()) == NULL)
377378 return -4;
378- if ((sig->r = BN_new()) == NULL)
379+ if ((r = BN_new()) == NULL)
379380 return -5;
380- if ((sig->s = BN_new()) == NULL)
381+ if ((s = BN_new()) == NULL)
381382 return -6;
383+ ECDSA_SIG_set0(sig, r, s);
382384
383- buffer_get_bignum2(&sigblob, sig->r);
384- buffer_get_bignum2(&sigblob, sig->s);
385+ buffer_get_bignum2(&sigblob, r);
386+ buffer_get_bignum2(&sigblob, s);
385387 if (sigblob != ptr) {
386388 return -7;
387389 }
@@ -1649,6 +1651,7 @@
16491651 u_char digest[EVP_MAX_MD_SIZE];
16501652 u_int len, dlen, nid;
16511653 buffer_t *buf2 = NULL;
1654+ BIGNUM *br, *bs;
16521655
16531656 nid = keytype_to_hash_nid(keypair->type);
16541657 if ((evp_md = EVP_get_digestbynid(nid)) == NULL) {
@@ -1670,8 +1673,9 @@
16701673 // TODO: error check
16711674 goto error;
16721675 }
1673- buffer_put_bignum2(buf2, sig->r);
1674- buffer_put_bignum2(buf2, sig->s);
1676+ ECDSA_SIG_get0(sig, &br, &bs);
1677+ buffer_put_bignum2(buf2, br);
1678+ buffer_put_bignum2(buf2, bs);
16751679 ECDSA_SIG_free(sig);
16761680
16771681 s = get_sshname_from_key(keypair);
旧リポジトリブラウザで表示