Browse Source

Update citations to RFC 8410.

Confirmed the section numbers and sample key still match.

Change-Id: I6901154a54972a18e8a582a25d902c4fe760a0fc
Reviewed-on: https://boringssl-review.googlesource.com/30464
Commit-Queue: Steven Valdez <svaldez@google.com>
Reviewed-by: Steven Valdez <svaldez@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
kris/onging/CECPQ3_patch15
David Benjamin 6 years ago
committed by CQ bot account: commit-bot@chromium.org
parent
commit
4e446f27d0
3 changed files with 7 additions and 7 deletions
  1. +2
    -2
      crypto/evp/evp_tests.txt
  2. +4
    -4
      crypto/evp/p_ed25519_asn1.c
  3. +1
    -1
      crypto/obj/objects.txt

+ 2
- 2
crypto/evp/evp_tests.txt View File

@@ -140,12 +140,12 @@ PublicKey = Ed25519-SPKI-NULL
Input = 302c300706032b65700500032100d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a
Error = DECODE_ERROR

# Sample public key from draft-ietf-curdle-pkix-04.
# Sample public key from RFC 8410.
PublicKey = Ed25519-SPKI-Spec
Type = Ed25519
Input = 302a300506032b657003210019bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1

# Sample private key from draft-ietf-curdle-pkix-04.
# Sample private key from RFC 8410.
PrivateKey = Ed25519-Spec
Type = Ed25519
Input = 302e020100300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f44755842


+ 4
- 4
crypto/evp/p_ed25519_asn1.c View File

@@ -57,7 +57,7 @@ static int set_privkey(EVP_PKEY *pkey, const uint8_t privkey[64]) {
}

static int ed25519_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) {
// See draft-ietf-curdle-pkix-04, section 4.
// See RFC 8410, section 4.

// The parameters must be omitted. Public keys have length 32.
if (CBS_len(params) != 0 ||
@@ -72,7 +72,7 @@ static int ed25519_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) {
static int ed25519_pub_encode(CBB *out, const EVP_PKEY *pkey) {
const ED25519_KEY *key = pkey->pkey.ptr;

// See draft-ietf-curdle-pkix-04, section 4.
// See RFC 8410, section 4.
CBB spki, algorithm, oid, key_bitstring;
if (!CBB_add_asn1(out, &spki, CBS_ASN1_SEQUENCE) ||
!CBB_add_asn1(&spki, &algorithm, CBS_ASN1_SEQUENCE) ||
@@ -96,7 +96,7 @@ static int ed25519_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) {
}

static int ed25519_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) {
// See draft-ietf-curdle-pkix-04, section 7.
// See RFC 8410, section 7.

// Parameters must be empty. The key is a 32-byte value wrapped in an extra
// OCTET STRING layer.
@@ -123,7 +123,7 @@ static int ed25519_priv_encode(CBB *out, const EVP_PKEY *pkey) {
return 0;
}

// See draft-ietf-curdle-pkix-04, section 7.
// See RFC 8410, section 7.
CBB pkcs8, algorithm, oid, private_key, inner;
if (!CBB_add_asn1(out, &pkcs8, CBS_ASN1_SEQUENCE) ||
!CBB_add_asn1_uint64(&pkcs8, 0 /* version */) ||


+ 1
- 1
crypto/obj/objects.txt View File

@@ -1334,7 +1334,7 @@ secg-scheme 14 3 : dhSinglePass-cofactorDH-sha512kdf-scheme
# NID for X25519 (no corresponding OID).
: X25519

# See draft-ietf-curdle-pkix-04.
# See RFC 8410.
1 3 101 112 : ED25519

: ChaCha20-Poly1305 : chacha20-poly1305


Loading…
Cancel
Save